6 Sep 12:31
[groovy-user] Re: Support for unless / if expressions
From: Johnny Jian <johnnyjianhy@...>
Subject: [groovy-user] Re: Support for unless / if expressions
Newsgroups: gmane.comp.lang.groovy.user
Date: 2008-09-06 10:33:38 GMT
Subject: [groovy-user] Re: Support for unless / if expressions
Newsgroups: gmane.comp.lang.groovy.user
Date: 2008-09-06 10:33:38 GMT
Why not provide a method instead of a keyword, like the "use" method?
So the unless expression can be written as:
unless(x > 10) { doSomething() }
Then no grammar is needed to add.
So the unless expression can be written as:
unless(x > 10) { doSomething() }
Then no grammar is needed to add.
And of course it cannot support something like:
unless(x > 10) { doSomething() } else { doAnother() }
But this can keep things simple, and I think the else clause will make the unless statement hard to understand.
On Sep 5, 3:34 am, "Julien Ponge" <julien.po...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi everyone,
>
> I have filled a JIRA issue
> (http://jira.codehaus.org/browse/GROOVY-2892) a few weeks backs with
> the idea of adding support for unless / if expressions to Groovy,
> like:
>
> doSomething() unless (x > 10)
> (...)
> triggerSomethingNasty() if (x < 10)
>
> Jochen suggested discussing this with the Groovy users community.
>
> What do you think?
>
> --http://izpack.org/http://jpz-log.info/
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
RSS Feed