array>quotation silliness #1723

Open
bjourne opened this Issue Oct 8, 2016 · 0 comments

Projects

None yet

1 participant

@bjourne
Member
bjourne commented Oct 8, 2016

Try this:

IN: scratchpad { 33 } [ array>quotation dup call drop ] keep 

--- Data stack:
[ 33 ]
{ 33 }

Change first element of array updates quotation:

IN: scratchpad"foo" 0 rot set-nth 

--- Data stack:
[ "foo" ]

Then calling it gives the wrong result:

IN: scratchpad call

--- Data stack:
33

To solve it primitive_array_to_quotation could clone the array it is constructing the quotation from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment