▲ | jasperry 3 days ago | |||||||
Seconded. Languages could even use "function" only for pure functions and "procedure" for everything else. Pascal uses "procedure" for things that don't return a value, but I think the pure vs. side effect distinction is more useful. | ||||||||
▲ | austin-cheney 3 days ago | parent [-] | |||||||
In languages that have block scope a procedure is that block. It’s a boundary but receives no input and does not return output. Functions do allow input and do return output. This distinction is clear in C lang that has both functions and procedures. As a new language design feature procedures could be assigned to references for reuse in the same way as calling a function by name/variable. | ||||||||
|