How to instantiate a map with multiple functions

Fusxfaranto via Digitalmars-d-learn digitalmars-d-learn at
Sat Dec 26 11:38:16 PST 2015

On Saturday, 26 December 2015 at 19:30:24 UTC, karthikeyan wrote:
> How to instantiate a map with multiple functions. I looked into 
> the docs at 
> They 
> contain a string which I suppose is a mixin and when I change 
> "a" to some other name it results in an error for me. Are there 
> any ways to use lambda functions directly instead of strings 
> and any explanation of the strings used in the map example and 
> why a is used will be helpful.
> I tried reading the source 
> .Some hint that "a" should be used at but how do I change that since map doesn't allow me any params to specify the parameter name. Also how can I map an array of tuples with two or more elements with a function of two or more params like unpack the tuple into a function like that. I am D beginner so any will insights will be very helpful for me.
> I am using dmd version 2.069 on Linux Mint 15 - 64bit

You should be able to just use any function (including lambdas) 
as a template argument to map.  The string version is from before 
the more concise "=>" lambda syntax was developed, and generally 
isn't what you want to use nowadays.

More information about the Digitalmars-d-learn mailing list