Grafting Functional Support on Top of an Imperative Language

Don Clugston dac at nospam.com.au
Sat Apr 5 01:56:09 PDT 2008


Walter Bright wrote:
> Andrei Alexandrescu's talk just given at ACCU:
> 
> http://www.digitalmars.com/d/2.0/accu-functional.pdf

The next step after allowing modification of 'automatic state' is to allow 
nested functions which modify local variables, which should be easy enough to check.
Seems to me that D remains an imperative language, but allows you to insert 
functional programming "walls" between parts of the program. Will be fascinating 
to see how much of the benefits of FP this gives us.

I suspect that ultimately, a go-between "possibly pure"* qualifier for functions 
will be desirable, just as const acts as "possibly invariant".
But that's just a hunch.

*an amoral function -- pure if used in pure surroundings, impure if surrounded 
in bad company. <g>



More information about the Digitalmars-d mailing list