You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
these operators are used by python to produce list-comprehensions and the like. Our list-each and set-each macros look up and call the append / add methods directly. It might be nice to mimic python more by providing these operators.
The text was updated successfully, but these errors were encountered:
Because of the nature of these operators, it may be best to implement list-each, set-each, dict-each as specials.
The change of heart is because of two features of these op codes:
the opcode takes a variable offset for the list, set, or dict to add into, rather than popping it from the stack like a normal operation
the opcode leaves the collection in place after consuming the new value. This is so that the collection can be reused in this manner over and over without having to re-load it, and so that at the end of the loop it can be the result.
If I create these specials, I no longer need to enter a new namespace or function, I just need to do a simple loop (not even one that can break).
these operators are used by python to produce list-comprehensions and the like. Our list-each and set-each macros look up and call the append / add methods directly. It might be nice to mimic python more by providing these operators.
The text was updated successfully, but these errors were encountered: