jbanana: Badly drawn banana (Default)
posted by [personal profile] jbanana at 04:14pm on 28/02/2011
I've been using Groovy. It's a pleasant scripting language that runs in a JVM, and has a Java-ish syntax. There are a number of differences to Java. One is it's relaxed attitude to typing, which I noticed when returning to something I wrote a while ago.
if ( someCondition ) {
    // do stuff...
} else if ( anotherCondition ) {
    // do other stuff...
} else {
    barf
}
WTF is barf? It looks like I was roughing out the code, and intending to come back to throw some exception if neither condition is true. In Java, the compiler would have complained about barf. But in the relaxed world of Groovy, the code works. After a little testing, I find that executing barf produces groovy.lang.MissingPropertyException: No such property: barf which is pretty much what I wanted!

Reply

From:
Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address. Sign in using OpenID.
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.

Links

June

SunMonTueWedThuFriSat
            1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9 10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30