literals vocab. you can interpolate CONSTANT-WORD values into a literal sequence with { $ CONSTANT-WORD } .

db4
Joe Groff 2008-12-08 23:13:26 -08:00
parent 02e961ac77
commit 4307234550
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,12 @@
USING: kernel literals tools.test ;
IN: literals.tests
<<
: five 5 ;
: seven-eleven 7 11 ;
: six-six-six 6 6 6 ;
>>
[ { 5 } ] [ { $ five } ] unit-test
[ { 7 11 } ] [ { $ seven-eleven } ] unit-test
[ { 6 6 6 } ] [ { $ six-six-six } ] unit-test

View File

@ -0,0 +1,4 @@
USING: continuations kernel parser words ;
IN: literals
: $ scan-word [ execute ] curry with-datastack ; parsing