functional

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Mar 10 09:00:14 PST 2010


On 03/10/2010 10:09 AM, James Iry wrote:
> I'm going to assume you meant "enforce" rather than "support" because
> both languages support immutability and purity precisely to the
> extent that the programmers want to use them (although, of the two,
> Scala's standard library has far more support).
>
> But even if you mean "enforce", you've still got a strange point of
> view.

Functional programming means (a) first-order functions, and (b) 
immutability. There are no ifs and buts about it. Every text on 
functional programming says as much. Even Wikipedia :o), but I'd 
recommend this classic:

https://docs.google.com/viewer?url=http://www.cs.chalmers.se/~rjmh/Papers/whyfp.pdf

The rest (lambdas, extensive use of recursion, pattern matching, let and 
letrec, monads, system(at)ic laziness) is aftermath, i.e. mechanisms 
that make it convenient to program given (a) and (b). There are no ifs 
and buts about that either.

Giving FP lip service by adopting FP's window dressing and syntactic 
sugar while at the same time not giving due consideration to FP's two 
fundamental tenets is, in my opinion, an ungainly move in the long term.


Andrei



More information about the Digitalmars-d mailing list