diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 0fabe98632..ce87bc6a82 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -4,6 +4,7 @@ - keyboard focus - keyboard gestures - text fields +- finish check boxes + compiler: @@ -15,7 +16,7 @@ - goal: to compile hash* optimally - type check/not-check entry points for compiled words - getenv/setenv: if literal arg, compile as a load/store -- empty ifte: wrong input type. +- compile tuple dispatch + oop: diff --git a/library/primitives.factor b/library/primitives.factor index ce1c816826..7dc72c8f1b 100644 --- a/library/primitives.factor +++ b/library/primitives.factor @@ -119,7 +119,7 @@ hashtables ; [ exit* [ [ integer ] [ ] ] ] [ client-socket [ [ string integer ] [ port port ] ] ] [ server-socket [ [ integer ] [ port ] ] ] - [ close-port [ [ port ] ] ] + [ close-port [ [ port ] [ ] ] ] [ add-accept-io-task [ [ port general-list ] [ ] ] ] [ accept-fd [ [ port ] [ string integer port port ] ] ] [ can-read-line? [ [ port ] [ boolean ] ] ] diff --git a/library/syntax/see.factor b/library/syntax/see.factor index 8d14ce7df5..abf7c593d3 100644 --- a/library/syntax/see.factor +++ b/library/syntax/see.factor @@ -44,34 +44,35 @@ presentation unparser words ; \ parsing prettyprint-prop \ inline prettyprint-prop ; -: prettyprint-comment ( comment -- ) - "comments" style write-attr ; +: comment. ( comment -- ) "comments" style write-attr ; -: infer-effect. ( effect -- ) - 0 swap - " ( " prettyprint-comment - 2unlist >r [ prettyprint-element ] each r> - "-- " write - [ prettyprint-element ] each - ")" prettyprint-comment - drop ; +: infer-effect. ( indent effect -- indent ) + " " write + [ + "(" , + 2unlist >r [ " " , unparse , ] each r> + " --" , + [ " " , unparse , ] each + " )" , + ] make-string comment. ; -: stack-effect. ( word -- ) +: stack-effect. ( indent word -- indent ) dup "stack-effect" word-property [ " " write - [ CHAR: ( , , CHAR: ) , ] make-string prettyprint-comment + [ CHAR: ( , , CHAR: ) , ] make-string + comment. ] [ "infer-effect" word-property dup [ infer-effect. ] [ - 2drop + drop ] ifte ] ?ifte ; : documentation. ( indent word -- indent ) "documentation" word-property [ "\n" split [ - "#!" swap cat2 prettyprint-comment + "#!" swap cat2 comment. dup prettyprint-newline ] each ] when* ;