Luke Daley | 6 Sep 11:48

[groovy-user] Support for 'unless'

The previous thread about unless was a bit complex as it combined the  
concept of 'unless' and having conditions after statements. I am bit  
worried that 'unless' by itself got a bit lost in that.

The consensus seemed to me to be that almost everyone who had used  
'unless', sees it's value.

To be clear,

unless (condition) {
	// stuff
} else unless (otherCondition) {
	// other stuff
}

which is equivalent to…

if (!condition) {
	// stuff
} else if (!otherCondition) {
	// other stuff
}

I didn't see the point of unless until it was available to me, now I  
am a big fan. It seemed very foreign to me when I started using perl  
and ruby and at that point I did question it's usefulness. Now though,  
it seems such an obvious win to aid readability.

Just wanted to get some people's opinions on this (and only this).

--

LD.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Gmane