4 ms·
Algol 60 is a marvel and I feel like it's a language every programmer should learn at least to the point of coding a few basic algorithms. The closest analog o
by User23 6y ago
Algol 60 is a marvel and I feel like it's a language every programmer should learn at least to the point of coding a few basic algorithms.
The closest analog of call by-name I can think of is Common Lisp macros.
- ncmncm 6y agoIn C++ you can pass a no-arguments lambda with local bindings that approximates pass-by-name. If actually evaluating the expression is something expensive and its result might not be needed, it can be the right thing. But whoever designs the function interface has to anticipate that possibility.