bootstrap.image.primitives: array>quotation can't be foldable
parent
88b2ed482c
commit
32825b9f5f
|
@ -689,7 +689,7 @@ CONSTANT: all-primitives {
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
"array>quotation" ( array -- quot ) "array_to_quotation"
|
"array>quotation" ( array -- quot ) "array_to_quotation"
|
||||||
{ array } { quotation } make-foldable
|
{ array } { quotation } make-flushable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
{ [ 3 ] } [ 3 [ ] curry ] unit-test
|
||||||
{ [ \ + ] } [ \ + [ ] curry ] unit-test
|
{ [ \ + ] } [ \ + [ ] curry ] unit-test
|
||||||
|
@ -15,3 +16,13 @@ USING: kernel math quotations sequences tools.test ;
|
||||||
{ [ "hi" ] } [ "hi" 1quotation ] unit-test
|
{ [ "hi" ] } [ "hi" 1quotation ] unit-test
|
||||||
|
|
||||||
[ 1 \ + curry ] must-fail
|
[ 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
|
||||||
|
|
Loading…
Reference in New Issue