Closed ghost closed 3 years ago
Hey! Please fix it. Then, Do you know how are symbols be binded to scopes? Could you tell me how?
I finally understood what is going on here, and I am not sure that technically is a bug: it's another recursion problem.
If you rename the key of your dictionary to something else than "square" (the name of your lambda) everything works as expected.
Here's what is going on... it is actually easier to reproduce as follows:
(dup *) ^square
{} 'square %square ; <-- this shouldn't be allowed!
:d
3 *d/square
Basically, the invoke (or with
in your case) is evaluating the symbol square
within the scope of d
.
Alright, so what's the value of square
? Well... a quotation containing square
that gets evaluated within the context of d
.
Alright, so what's the value of square
? Well... a quotation containing square
that gets evaluated within the context of d
.
...
I am not sure if I can prevent this from happening: I could check if you are trying to bind a quoted symbol which has the same value as the key, but I am not sure it's enough. Definitely it is going to cause trouble, so probably it shouldn't be allowed...
It even works without a lambda!!!
Fixed.
I interpreted below lines and min interactive shell shut itself down.
Another exit way from min opened 😄