]> gitweb.factorcode.org Git - factor.git/commitdiff
bootstrap.image.primitives: array>quotation can't be foldable
authorBjörn Lindqvist <bjourne@gmail.com>
Sat, 8 Oct 2016 13:12:39 +0000 (15:12 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Sat, 8 Oct 2016 22:47:37 +0000 (00:47 +0200)
basis/bootstrap/image/primitives/primitives.factor
core/quotations/quotations-tests.factor

index 5ffd047ad624e80e95eaa334550c847b303b513b..86d59932fe1db3eacc324c1a4ec1a6aeffb7b3cc 100644 (file)
@@ -689,7 +689,7 @@ CONSTANT: all-primitives {
         {
             {
                 "array>quotation" ( array -- quot ) "array_to_quotation"
-                { array } { quotation } make-foldable
+                { array } { quotation } make-flushable
             }
         }
     }
index 4deb0769bcbb711ade59ac5d9961a1ebea7001a1..ac2e1e97a3131b9d06fd6fbf7c2f17b00f053164 100644 (file)
@@ -1,4 +1,5 @@
-USING: kernel math quotations sequences tools.test ;
+USING: kernel math quotations.private sequences tools.test ;
+IN: quotations
 
 { [ 3 ] } [ 3 [ ] curry ] unit-test
 { [ \ + ] } [ \ + [ ] curry ] unit-test
@@ -15,3 +16,13 @@ USING: kernel math quotations sequences tools.test ;
 { [ "hi" ] } [ "hi" 1quotation ] unit-test
 
 [ 1 \ + curry ] must-fail
+
+: trouble ( -- arr quot ) { 123 } dup array>quotation ;
+
+{ 999 } [
+    ! Call the quotation which compiles it.
+    trouble call drop
+    ! Change the array used for it.
+    999 0 rot set-nth
+    trouble nip call
+] unit-test