tuples and freeze dried function args

Kevin Bealer kevinbealer at gmail.com
Fri Feb 23 10:31:09 PST 2007


You can.  I do this in the futurism library, see here:

http://www.dsource.org/projects/futurism/browser/trunk/futurism/future.d

The function make_future and the class template Future do this; the make_future
builds a future object which stores a delegate and its arguments.

Later, the program runs the function from these arguments.  There's a lot of other
code in that file... I think you can find a simpler example at the bottom of this
page:

http://www.digitalmars.com/d/tuple.html

'Functional' programming languages call this 'currying'.

Kevin


More information about the Digitalmars-d-learn mailing list