#1870 parameters

Rekdal Sun 8 Apr 2012

I saw that in Fantom we have defaulted parameters, that is we can assign a default value to a parameter. Are there named parameters too, like in Scala, or something to emulate them? Thx in advance.

ttmrichter Sun 8 Apr 2012

Any language that has associative array literals has something that emulates named parameters quite handily.

brian Mon 9 Apr 2012

Methods don't have named parameters per se, but as @ ttmrichter suggested, map literals are sometimes used as a solution:

fooBar(paramA, ["optA":true])

Rekdal Sun 15 Apr 2012

Ok, it's all right to me. Thx.

Login or Signup to reply.