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

Reply via email to