#clojure logs

2008-03-31

14:29abrooksIs there a Clojure way to convert strings to numbers (outside of using Java libs)? (int "123") did not have the expected effect.
14:30rhickeyno
14:30rhickeyyou could use read, but parseInt is easier
14:33abrooksOkay, just wanted to be sure I wasn't missing something.
14:33abrooks:)
14:35abrooksrhickey: Would you be against logic in "int" to call parseInt if passed a string? I could provide a patch.
14:36rhickeyIt should be limited to numeric conversion, not parsing. May eventually be inlined
14:41ericthorwhat is the coljure formula for passing an object[] to a java function?
14:41ericthorI used make-array to create the object array
14:41rhickeyjust pass it
14:42ericthorhow do I set a value in it?
14:42rhickeyaset fns
14:42ericthorthat's it
14:42ericthorthanks
16:21wabashHi. I'm investigating clojure, and I'd like to learn it after I learn more Scheme. I have just a curiousity question: Can you make native Java methods and have clojure call them? how about native-compiled C?
16:29jgracinwabash: pretty much everything Java can, you can do in Clojure.
16:30jgracinClojure is well integrated into JVM.
16:31jgracinSpecifically, see the docs for function proxy.
16:31jgracinand for reader macro "." (dot)
16:32jgracinups, it's not a reader macro, isn't it.
16:32wabashjgracin: Thank you. It's a good starting point for me.
16:32wabashare strings pooled like in Java?
16:35jgracinwabash: do you mean "interned"?
16:36jgracinas in "having a single instance of a string literal regardless of the number of occurances"
16:37albinoaren't clojure strings java strings? 1 for 1 I thought
16:37jgracinthey are (AFAIK), but interning works like described here: http://groups.google.com/group/clojure/browse_thread/thread/e43af17a0424b1cd#
16:38jgracincheck the reply from Rich
16:47wabashjgracin: Yes, I mean interned. The Java docs always called it pooled....
16:49wabashhey rhickey.
16:49rhickeyhi
16:49jgracinhi rich!
16:51rhickeyjgracin: did you ever do an ant version of your launch-from-jar patch?
16:51rhickeyour conversation got interrupted that day
16:51jgracinnope. I only use maven.
16:52rhickeyaah. I don't use either, but I'd like them both to do the same thing
16:52jgracinwhich build system do you use?
16:53rhickeyI just use IntelliJ
16:54jgracinI'm in the world of web applications where integration play a significant part of the job. Maven does wonders for me.
16:54jgracinplay->plays
16:55rhickeyI've heard good things
16:55jgracinI don't know anything about IntelliJ, but I keep hearing about it...
16:56rhickeyit's great
16:58jgracinoh, it's free for open source projects. I didn't know that. I'll have to check it out.
16:59jgracinno, it's not. :-(
16:59jgracinreading only the headlines is not enough.
17:01arbschtgee, that's a complicated licensing setup
17:02rhickeypersonal is $250
17:04jgracinI'm watching the videos. $250 is not that much.
17:05rhickeyworth every penny, if you've got it
17:05jgracinespecially with current eur/$ ratio
17:05rhickey:(
17:05albinowhat makes it better than eclipse?
17:06rhickeyit feels solid? (ducks)
17:06rhickeyfast
17:07rhickeystreamlined - for editing, not kitchen-sink do everything framework
17:13albinoIs it written in Java?
17:14rhickeyyes
22:03abrooksOkay, I'm confused. Does a hash map not index by identity? If I define this "(def m { '(1 2) 3 '(4 5) 6 })" I can do "(m '(4 5))" to get "6" but "(identical? '(4 5) '(4 5))" yields "false" as I'd expect. Are map keys interned in some way?
22:04abrooksIn python I'd need the very same instance of a tuple (or list) to retrieve a key's value, not just a tuple of identical composition.
22:24rhickeymaps are based on value equality
22:25abrooksHow do you hash the value of a list?
22:25abrooks(values)
22:26rhickey.hashCode, like all Objects
22:26rhickeythere isn't a wrapper function for it
22:27abrooksAh. I'll look a that.
23:50rhickeyConcurrency talk is up: http://www.clojure.org/news/concurrency_talk.html