This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: Passing associative parameters to a method?

No replies
Aishwarya Singhal
Joined: 2011-09-09,
User offline. Last seen 42 years 45 weeks ago.

awesome!! thanks a lot

On Nov 23, 4:59 pm, Ken Scambler wrote:
> On 23 November 2011 22:54, Aishwarya Singhal wrote:
>
> > Hi Ken
>
> > sure, thought about that too. the calling code would then look like
> > email.send(template, (p1,v1), (p2,v2), (p3, v3))... too many brackets
> > IMHO...
>
> You're in luck!  a -> b is in fact the very same thing as (a,b).   In
> Predef, any value is implicitly extended to have a -> method, which will
> yield a pair with the next value.
>
> Cheers,
> Ken

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland