On Monday, 30 March 2015 at 18:41:17 UTC, Russel Winder wrote:
On Mon, 2015-03-30 at 11:19 -0700, Walter Bright via Digitalmars-d-announce wrote:

My brain still thinks in terms of loops.

The excellent influence of functional programming on imperative
programming is implicit iteration and higher-order functions.

Any explicit for/while loop in a modern imperative language code
should *necessarily* involve a side-effect or it is coded wrongly. Even then it can almost certainly be recast to preserve the side- effect and remove the loop – unless you are implementing the implicit
iteration function.

This has nothing to do with tail recursion optimization and all that
Lambda Calculus stuff, this is to do with correct levels of
abstraction that allow the tool chain to maximize support for the

Java programmers are having to come to terms with this. Python
programmers sort of have, except that BDFL has failed to accept the correct end point and still likes loops. Scala has done it all wrong.
(Further opinions available on request :-)

speaking of optimization, are there any guarantees(documented?) on the kind of optimizations you should expect from range programming in D(i.e, function chaining) similar to Haskell's stream fusion?

Reply via email to