ensure accumulator comes back as a vector from literals

db4
Joe Groff 2009-01-26 15:47:52 -08:00
parent 217d4c4bc0
commit 8bb9429589
2 changed files with 9 additions and 3 deletions

View File

@ -11,4 +11,10 @@ IN: literals.tests
[ { 7 11 } ] [ { $ seven-eleven } ] unit-test
[ { 6 6 6 } ] [ { $ six-six-six } ] unit-test
[ { 6 6 6 7 } ] [ { $ six-six-six 7 } ] unit-test
[ { 8 8 8 } ] [ { $[ six-six-six [ 2 + ] tri@ ] } ] unit-test
[ { 0.5 2.0 } ] [ { $[ 1.0 2.0 / ] 2.0 } ] unit-test
[ { 1.0 { 0.5 1.5 } 4.0 } ] [ { 1.0 { $[ 1.0 2.0 / ] 1.5 } $[ 2.0 2.0 * ] } ] unit-test

View File

@ -1,6 +1,6 @@
! (c) Joe Groff, see license for details
USING: continuations kernel parser words quotations ;
USING: continuations kernel parser words quotations vectors ;
IN: literals
: $ scan-word [ execute ] curry with-datastack ; parsing
: $[ \ ] parse-until >quotation with-datastack ; parsing
: $ scan-word [ execute ] curry with-datastack >vector ; parsing
: $[ \ ] parse-until >quotation with-datastack >vector ; parsing