#clojure logs

2008-05-11

11:31ChouserHmph. Java is still missing functionality that I would consider "basic". The same kind of stuff that frustrated me about CL.
11:31jteosuch as?
11:31ChouserApparently there's no support for creating symlinks or interacting with Unix domain sockets.
11:32ChouserHow can symlinks still be missing?? Apparently that's planned for Java 1.7 (!)
11:34arbschtplatform independence is restrictive
11:37jteolowest common denominator and all that.
11:38esquesque_hi, does anyone know why (. java.lang.Object class) doesn't work?
11:38esquesque_i realise that's not a real field
11:38esquesque_is there any way to get the class object?
11:39esquesque_other than passing getClass to an instance
11:39esquesque_help appreciated :)
11:47esquesque_duh, it's (class class-name)
11:51rhickeyesquesque_: 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:52esquesque_oh, that helps alot. thanks :)
12:14Chouserplatform independence is a cop-out. There is a long list of platform independant langauges that still provide platform specific features when available.
12:14ChouserIt's the difference between cute and useful.
12:17rhickeyChouser: is there no library for that stuff? From Apache for instance?
12:21rhickeyhttp://www.koders.com/java/fid8492D956F2FCACDBDEC926248491D180B311C813.aspx
12:25Chouserheh. I big ol' wrapper around shelling out. I guess I can use (.. Runtime (getRuntime) (exec "ln -s ...")) myself.
12:27rhickey:)
12:28rhickeyNot something to switch platforms/languages over...
12:29ChouserI guess. Unix sockets are a bit trickier. The libraries I've found that try to do them have rather poor quality.
12:32rhickeyThere are good reasons to move away from OS-specific facilities in general, although in specific cases that doesn't apply.
12:41rhickeyChouser: j-buds and juds?
12:50ChouserI don't know what those are.
12:50Chouser...and google isn't helping me. :-)
12:51Chouseroh, http://code.google.com/p/juds/
13:47agriffisso google *is* helping you
14:05Chouser:-)
19:29esquesque_is there any way to nest recurs?
19:31rhickey_no, recur must be in tail position and jumps to the nearest enclosing loop/fn.
19:34esquesque_ok, say i have a seq of map keys
19:34esquesque_i need to set all of these corresponding values to a default value
19:34esquesque_how would i accomplish that neatly?
19:36rhickey_(reduce (fn [m k] (assoc m k the-default-val)) the-map the-keys)
20:01esquesque_brilliant, thanks rhickey_