21 Jun 23:34
[groovy-dev] advice needed
From: Alex Tkachman <alex.tkachman@...>
Subject: [groovy-dev] advice needed
Newsgroups: gmane.comp.lang.groovy.devel
Date: 2008-06-21 21:36:10 GMT
Subject: [groovy-dev] advice needed
Newsgroups: gmane.comp.lang.groovy.devel
Date: 2008-06-21 21:36:10 GMT
Hi!
I've implemented default return from if/else
def f () {
if (true)
1
}
assertEquals 1, f()
It is not commited yet but works nicely including nested ifs, closures etc.
Now I try to do the same for switch (which is relatively easy) and
try/catch/finally (which is complicated), obviously that unfortunately
there is no intuitively clear meaning of such return for loops.
The main problem with try/catch/finally is how should it work. The
question is what should be returned in case of last statement
try {
......
1
}
catch (Throwable t) {
"exception"
}
finally {
0
}
(Continue reading)
RSS Feed