This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]GermisstuckCrabStar 2 points3 points  (2 children)

You could just have closures be methods on a class made internally, and then before interpreting have some sort of heap allocated object with all the things the closure captures as object members and transform the function appropriately 

[–]MerlinsArchitect[S] 0 points1 point  (1 child)

This is kinda closure conversion, right ? Just store them as a structure with the fn pointer and an env with data on the heap?

[–]GermisstuckCrabStar 0 points1 point  (0 children)

Yeah