]> gitweb.factorcode.org Git - factor.git/commitdiff
'[ ] should make an empty quot
authorJoe Groff <arcata@gmail.com>
Wed, 11 Nov 2009 21:50:20 +0000 (15:50 -0600)
committerJoe Groff <arcata@gmail.com>
Wed, 11 Nov 2009 21:50:20 +0000 (15:50 -0600)
basis/fry/fry-tests.factor
basis/fry/fry.factor

index 10d9b282adef77dd86f16b034dfd107385160da1..f33eb276a0e88f6320ff920865811e7321ac352e 100644 (file)
@@ -5,6 +5,8 @@ IN: fry.tests
 
 SYMBOLS: a b c d e f g h ;
 
+[ [ ] ] [ '[ ] ] unit-test
+[ [ + ] ] [ '[ + ] ] unit-test
 [ [ 1 ] ] [ 1 '[ _ ] ] unit-test
 [ [ 1 ] ] [ [ 1 ] '[ @ ] ] unit-test
 [ [ 1 2 ] ] [ [ 1 ] [ 2 ] '[ @ @ ] ] unit-test
index 931397e933f9cdb206bfcb5ecdf6b98180b58dca..e58253692f8fda4259ec6041fc95c7b9f03fd406 100644 (file)
@@ -136,10 +136,12 @@ TUPLE: dredge-fry-state
 PRIVATE>
 
 M: callable fry ( quot -- quot' )
-    0 swap <dredge-fry>
-    [ dredge-fry ] [
-        [ prequot>> >quotation ]
-        [ quot>> >quotation shallow-fry ] bi append
-    ] bi ;
+    [ [ [ ] ] ] [
+        0 swap <dredge-fry>
+        [ dredge-fry ] [
+            [ prequot>> >quotation ]
+            [ quot>> >quotation shallow-fry ] bi append
+        ] bi
+    ] if-empty ;
 
 SYNTAX: '[ parse-quotation fry append! ;