Wols Lists wrote:
On 18/04/15 19:56, PMA wrote:
AFAIK, of our major ancestor languages, only Pascal insisted on a
literal working
function-vs-procedure distinction. Did Wirth ever defend this insistence
(as more
than a track-keeping enforcer re value-outputting vs
non-value-outputting code)?

Actually, so did Fortran, I believe.

Note my earlier comment that a function was defined as having a return
value with no side effects. That then permits aggressive compiler
optimisation - if a function is repeatedly called with the same
argument, the compiler can stash the result of the first call away, and
replace subsequent calls with a lookup table. (And given that Fortran
was meant to be fast and maths-like, that behaviour was actually very
sensible ... :-)

But because programmers were bad at writing "proper" functions, this
caused too many bugs and I think it just became accepted that functions
have side effects and such optimisation was not a good idea.

Cheers,
Wol

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Aha.  So the improper-er their code got, the tougher time
compilers had trying to -- as Martin says -- "throw it out".

All told, is there now any real need _not_ to use the terms
"function" and "procedure" interchangeably?  That is, any
real need to try to enforce such a distinction?  The terms
are conflated, everybody knows, and there's no problem.

(No response expected -- at this point I'm just ranting.)
PMA

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to