#clojure log - Mar 31 2008

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

14:29 abrooks: Is there a Clojure way to convert strings to numbers (outside of using Java libs)? (int "123") did not have the expected effect.

14:30 rhickey: no

14:30 you could use read, but parseInt is easier

14:33 abrooks: Okay, just wanted to be sure I wasn't missing something.

14:33 :)

14:35 rhickey: Would you be against logic in "int" to call parseInt if passed a string? I could provide a patch.

14:36 rhickey: It should be limited to numeric conversion, not parsing. May eventually be inlined

14:41 ericthor: what is the coljure formula for passing an object[] to a java function?

14:41 I used make-array to create the object array

14:41 rhickey: just pass it

14:42 ericthor: how do I set a value in it?

14:42 rhickey: aset fns

14:42 ericthor: that's it

14:42 thanks

16:21 wabash: Hi. 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:29 jgracin: wabash: pretty much everything Java can, you can do in Clojure.

16:30 Clojure is well integrated into JVM.

16:31 Specifically, see the docs for function proxy.

16:31 and for reader macro "." (dot)

16:32 ups, it's not a reader macro, isn't it.

16:32 wabash: jgracin: Thank you. It's a good starting point for me.

16:32 are strings pooled like in Java?

16:35 jgracin: wabash: do you mean "interned"?

16:36 as in "having a single instance of a string literal regardless of the number of occurances"

16:37 albino: aren't clojure strings java strings? 1 for 1 I thought

16:37 jgracin: they are (AFAIK), but interning works like described here: http://groups.google.com/group/clojure/browse_thread/thread/e43af17a0424b1cd#

16:38 check the reply from Rich

16:47 wabash: jgracin: Yes, I mean interned. The Java docs always called it pooled....

16:49 hey rhickey.

16:49 rhickey: hi

16:49 jgracin: hi rich!

16:51 rhickey: jgracin: did you ever do an ant version of your launch-from-jar patch?

16:51 our conversation got interrupted that day

16:51 jgracin: nope. I only use maven.

16:52 rhickey: aah. I don't use either, but I'd like them both to do the same thing

16:52 jgracin: which build system do you use?

16:53 rhickey: I just use IntelliJ

16:54 jgracin: I'm in the world of web applications where integration play a significant part of the job. Maven does wonders for me.

16:54 play->plays

16:55 rhickey: I've heard good things

16:55 jgracin: I don't know anything about IntelliJ, but I keep hearing about it...

16:56 rhickey: it's great

16:58 jgracin: oh, it's free for open source projects. I didn't know that. I'll have to check it out.

16:59 no, it's not. :-(

16:59 reading only the headlines is not enough.

17:01 arbscht: gee, that's a complicated licensing setup

17:02 rhickey: personal is $250

17:04 jgracin: I'm watching the videos. $250 is not that much.

17:05 rhickey: worth every penny, if you've got it

17:05 jgracin: especially with current eur/$ ratio

17:05 rhickey: :(

17:05 albino: what makes it better than eclipse?

17:06 rhickey: it feels solid? (ducks)

17:06 fast

17:07 streamlined - for editing, not kitchen-sink do everything framework

17:13 albino: Is it written in Java?

17:14 rhickey: yes

22:03 abrooks: Okay, 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:04 In 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:24 rhickey: maps are based on value equality

22:25 abrooks: How do you hash the value of a list?

22:25 (values)

22:26 rhickey: .hashCode, like all Objects

22:26 there isn't a wrapper function for it

22:27 abrooks: Ah. I'll look a that.

23:50 rhickey: Concurrency talk is up: http://www.clojure.org/news/concurrency_talk.html

Logging service provided by n01se.net