- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Re: Passing associative parameters to a method?
Wed, 2011-11-23, 13:05
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