language.funktors: initial stab at replacing FUNCTOR:

locals-and-roots
Doug Coleman 2016-06-10 12:53:05 -07:00
parent 3199c23f17
commit 70222b73e6
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
USING: accessors effects.parser eval grouping interpolate kernel
multiline namespaces parser sequences sets splitting
vocabs.parser words ;
in: funktors
SYNTAX: \ factor[[ "]]" parse-multiline-string
manifest get search-vocab-names>>
{ "syntax" } diff members
current-vocab name>> ".private" ?tail drop ".private" append suffix
'[
_ interpolate>string
current-vocab name>> "\nIN: " "\n" surround prepend
_ 5 group [ " " join ] map "\n" join
"USING: " " ;\n" surround prepend
eval( -- )
] suffix! ;
SYNTAX: \ FUNKTOR:
scan-new-escaped scan-effect scan-object
'[ _ call ] swap define-declared ;