Accessing nested classes?

39 views
Skip to first unread message

dun...@cogitat.io

unread,
Apr 13, 2014, 4:01:02 PM4/13/14
to erj...@googlegroups.com
I'm trying to figure out how to create a SimpleEntry from this class:
  http://docs.oracle.com/javase/7/docs/api/java/util/AbstractMap.html

And here:
  http://docs.oracle.com/javase/7/docs/api/java/util/AbstractMap.SimpleEntry.html

Neither of these following worked:
 * (java.util.AbstractMap.SimpleEntry '"a" '"b")
 * (java.util.AbstractMap:SimpleEntry '"a" '"b")

and I couldn't think of any other syntax that would make sense...

Any ideas?

d

Kresten Krab Thorup

unread,
Apr 14, 2014, 3:32:36 AM4/14/14
to erj...@googlegroups.com
Here you go. Hint: Nested classes in Java internally use ‘$’; clojure obviously figures this out.

Kresten

dhcp-129:erjang krab$ ./jerl
** Erjang R15B03 ** [root:/usr/local/lib/erlang] [erts:5.9.3.1] [smp S:2 A:10] [java:1.7.0_51] [unicode]
Eshell V5.9.3.1 (abort with ^G)
1> Se = 'java.util.AbstractMap$SimpleEntry':new("a", "b").
<<>>
2> Se:getKey().
"a"
3> Se:getValue().
"b"
4>


Mobile: + 45 2343 4626 | Skype: krabtrifork | Twitter: @drkrab
Trifork A/S | Margrethepladsen 4 | DK- 8000 Aarhus C | Phone : +45 8732 8787 | www.trifork.com
> --
> You received this message because you are subscribed to the Google Groups "Erjang" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to erjang+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

signature.asc

Duncan McGreggor

unread,
Apr 14, 2014, 3:56:20 AM4/14/14
to erj...@googlegroups.com
Oh, sweet -- thanks!

jlfe docs update with that:
  https://github.com/oubiwann/jlfe#jlfe-usage

d
Reply all
Reply to author
Forward
0 new messages