3 ms·
Perhaps a stupid question, but why not introduce an explicit "evaluate" operator, and keep the rest of the language lazy? That would prevent treating function
by amelius 8y ago
Perhaps a stupid question, but why not introduce an explicit "evaluate" operator, and keep the rest of the language lazy?
That would prevent treating function calls as special.
- jhallenworld 8y agoWell the language is not LISP, meaning that the source is immediately compiled (to byte code in this case), and provides no access to an AST that can be manipulated. It's interesting to see how far you can get without eval.
- kazinator 8y agoThe evaluate operator would require an environment parameter in order to avoid capture issues in the same way as passing down the lambda. If you're passing around a piece of code with an environment, you effectively have a lambda already: one that is condemned to slow interpretation. Without the environment passing for proper referencing semantics, the implementation wouldn't be a correct call-by-name reference; it would not pass Knuth's Man-or-boy test. https://en.wikipedia.org/wiki/Man_or_boy_test https://en.wikipedia.org/wiki/Man_or_boy_test