Just reviewing yesterday's code, this is pretty neat;
My Java method for calling ruby script from Android, notice that it returns a generic Java Object (no type):
<div class="java" id="{CB}" style="font-family: monospace;"><ol><span style="color: #000000; font-weight: bold;">private <span style="color: #000000; font-weight: bold;">native [url=http://www.google.com/search?hl=en&q=allinurl%3AObject+java.sun.com&btnI=I%27m%20Feeling%20Lucky]<span style="color: #aaaadd; font-weight: bold;">Object[/url] exec([url=http://www.google.com/search?hl=en&q=allinurl%3AString+java.sun.com&btnI=I%27m%20Feeling%20Lucky]<span style="color: #aaaadd; font-weight: bold;">String[/url] ruby);
This is Java calling C, which runs Ruby, which returns the result to C, which makes a Java Object (still in C) which is then returned to Java.
So when I call the ruby script:
x = 256 * 2
x # Returns Java Integer with value 512
y = "Hello, world!"
y # Return Java String with value "Hello, world!"
Need to do extra stuff for maps and arrays (at the moment, all other cases that don't match are returned as Strings), but I really think this is neat - yet no-one will ever see it.