'[ ] should make an empty quot

db4
Joe Groff 2009-11-11 15:50:20 -06:00
parent eac9bacf40
commit 324889e2ac
2 changed files with 9 additions and 5 deletions

View File

@ -5,6 +5,8 @@ IN: fry.tests
SYMBOLS: a b c d e f g h ; SYMBOLS: a b c d e f g h ;
[ [ ] ] [ '[ ] ] unit-test
[ [ + ] ] [ '[ + ] ] unit-test
[ [ 1 ] ] [ 1 '[ _ ] ] unit-test [ [ 1 ] ] [ 1 '[ _ ] ] unit-test
[ [ 1 ] ] [ [ 1 ] '[ @ ] ] unit-test [ [ 1 ] ] [ [ 1 ] '[ @ ] ] unit-test
[ [ 1 2 ] ] [ [ 1 ] [ 2 ] '[ @ @ ] ] unit-test [ [ 1 2 ] ] [ [ 1 ] [ 2 ] '[ @ @ ] ] unit-test

View File

@ -136,10 +136,12 @@ TUPLE: dredge-fry-state
PRIVATE> PRIVATE>
M: callable fry ( quot -- quot' ) M: callable fry ( quot -- quot' )
0 swap <dredge-fry> [ [ [ ] ] ] [
[ dredge-fry ] [ 0 swap <dredge-fry>
[ prequot>> >quotation ] [ dredge-fry ] [
[ quot>> >quotation shallow-fry ] bi append [ prequot>> >quotation ]
] bi ; [ quot>> >quotation shallow-fry ] bi append
] bi
] if-empty ;
SYNTAX: '[ parse-quotation fry append! ; SYNTAX: '[ parse-quotation fry append! ;