3 ms·
The "call by name vs call by value" joke at Niklaus Wirth's expense :-)
by gandalfgeek 6y ago
The "call by name vs call by value" joke at Niklaus Wirth's expense :-)
- Taniwha 6y agocall by name is an abomination - essentially you can call func(a[b]) ... every time func's parameter is referenced inside a[b] is reevaluated - b can be a global or a local in the function making the call, inside the function you can read the resulting value or even assign to it .... essentially you need to pass a small code fragment that returns the address of a[b] (except that you can also pass "1" and what happens when you assign to that). That and Algol60 scoping were probably the main mistakes in Algol60 - people were still figuring that stuff out back then.