#clojure log - May 11 2008

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

11:31 Chouser: Hmph. Java is still missing functionality that I would consider "basic". The same kind of stuff that frustrated me about CL.

11:31 jteo: such as?

11:31 Chouser: Apparently there's no support for creating symlinks or interacting with Unix domain sockets.

11:32 How can symlinks still be missing?? Apparently that's planned for Java 1.7 (!)

11:34 arbscht: platform independence is restrictive

11:37 jteo: lowest common denominator and all that.

11:38 esquesque_: hi, does anyone know why (. java.lang.Object class) doesn't work?

11:38 i realise that's not a real field

11:38 is there any way to get the class object?

11:39 other than passing getClass to an instance

11:39 help appreciated :)

11:47 duh, it's (class class-name)

11:51 rhickey: esquesque_: just using the class name gives you the class object in all cases except following '.' operator, where it indicates class scope. So Object names the Object class. As you found, the class of an instance x can be obtained with (class x)

11:52 esquesque_: oh, that helps alot. thanks :)

12:14 Chouser: platform independence is a cop-out. There is a long list of platform independant langauges that still provide platform specific features when available.

12:14 It's the difference between cute and useful.

12:17 rhickey: Chouser: is there no library for that stuff? From Apache for instance?

12:21 http://www.koders.com/java/fid8492D956F2FCACDBDEC926248491D180B311C813.aspx

12:25 Chouser: heh. I big ol' wrapper around shelling out. I guess I can use (.. Runtime (getRuntime) (exec "ln -s ...")) myself.

12:27 rhickey: :)

12:28 Not something to switch platforms/languages over...

12:29 Chouser: I guess. Unix sockets are a bit trickier. The libraries I've found that try to do them have rather poor quality.

12:32 rhickey: There are good reasons to move away from OS-specific facilities in general, although in specific cases that doesn't apply.

12:41 Chouser: j-buds and juds?

12:50 Chouser: I don't know what those are.

12:50 ...and google isn't helping me. :-)

12:51 oh, http://code.google.com/p/juds/

13:47 agriffis: so google *is* helping you

14:05 Chouser: :-)

19:29 esquesque_: is there any way to nest recurs?

19:31 rhickey_: no, recur must be in tail position and jumps to the nearest enclosing loop/fn.

19:34 esquesque_: ok, say i have a seq of map keys

19:34 i need to set all of these corresponding values to a default value

19:34 how would i accomplish that neatly?

19:36 rhickey_: (reduce (fn [m k] (assoc m k the-default-val)) the-map the-keys)

20:01 esquesque_: brilliant, thanks rhickey_

Logging service provided by n01se.net