14 Jul 2004 18:33
Re: how to declare the Closure
On 14 Jul 2004, at 17:26, 中原 慶 wrote:
> Hi.
> I am so interested in Groovy and began to learn.
> then, I have a question.
>
> When I declare the Closure,then I write
>
> --------------------------------------------------------
> hoge = { param | println "param is ${param}"}
> --------------------------------------------------------
>
> but,I read the report the declaration method of Closure changes.
>
> --------------------------------------------------------
> hoge = { | param | println "param is ${param}"}
> --------------------------------------------------------
>
> is this a really?
> And can I know truth, if where is seen?
We're debating in the JSR whether, in the face of the logical operator
the first shorthand notation can be used - I'm hopeful we can keep
that. Rght now the 2nd form works well and is less ambiguous but
hopefully you'll be able to use the shorter version too. Today in CVS
HEAD both work.
James
-------
http://radio.weblogs.com/0112098/
RSS Feed