#clojure log - Nov 02 2008

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

1:06 asbjxrn: Is anyone using any profiling tools they can recommend?

3:57 Lau_of_DK: Morning guys

4:14 Kerris4: morning Lau_of_DK

4:20 Lau_of_DK: I asked this question yesterday and I still need answers. I have a directory structure on my HD which is similar to /foo/bar/Baz.class* and I need to be able to (import '(foo.bar Baz)) - How do I do this ?

4:43 cgrand: Lau_of_DK: did you try to add / to the classpath?

4:43 Lau_of_DK: Yes

4:44 (btw. Welcome back from holiday cgrand, hope you had a good one)

4:57 cgrand: no idea then :-(

8:13 tomppa: Is there some clean and idiomatic way to update structures? Especially when updating several (possibly interdependent) fields I end up with several nested ASSOCs which look quite ugly

8:13 Chouser: assoc-in

8:15 tomppa: that looks better. I was thinking about writing a macro that would be a bit like a combination of Haskell struct update syntax and CLs WITH-ACCESSORS

8:15 Chouser: there's also update-in

8:19 tomppa: Thanks, I'll have to play with those

9:26 rhickey: http://thediscoblog.com/2008/11/02/poll-javas-2008-memorable-moment/

9:27 duck1123: voted

9:28 Chouser: heh, results seem a little skewed

9:29 kotarak: hehe

11:46 kib2: Hi, stupid question but why when I type (1 2 3) in the REPL do I get an error ?

11:47 Kerris4: what is the expected output, kib2?

11:47 kib2: (1 2 3) like in Lisp

11:48 sorry, I though it was. But it raises an error too.

11:49 because it's not a function

11:50 Hun: that's because 1 is (usually) not a function

11:50 vy: Hi! How can I get a list of all available symbols (functions, variables, macros, etc.) in a specific namespace?

11:51 danlarkin: kib2: if you want the literal list (1 2 3) you can type '(1 2 3)

11:51 kib2: danlarkin: yes, I must escape the eveluation, that's it ?

11:52 danlarkin: kib2: yup

11:52 kib2: (list 1 2 3) produces the list (1 2 3) too... but you'll see the first element in that list is a function

11:53 kib2: a thing I cannot understand well at the moment is how to deal with global variables.

11:53 danlarkin: yes, thanks.

11:54 Hun: what's the problem with globals?

11:55 kib2: Hun : I'm currently reading "Practical Common Lisp" by Seibel, he uses globals all the times ,ie *db* and Clojure does not from what I've read.

11:55 Chouser: vy: (ns-publics 'clojure)

11:56 Hun: those are special (aka dynamic) variables

11:56 which can be dynamically rebound

11:56 iirc there's bind or binding in clojure (have no repl at this machine)

11:57 Kerris4: kib2: you might be interested in Stuart Holloway's port of the Practical Common Lisp code samples to Clojure

11:57 http://blog.thinkrelevance.com/2008/9/16/pcl-clojure

11:57 vy: Chouser: Thanks.

11:58 kib2: yes, but does Clojure has something like this too or should I write any function using my database with another argument ie 'db' and pass it trhough each time ?

11:58 Kerris4: really nice, thanks !

11:59 Kerris4: You're welcome, I'm new to both Lisp and Clojure and Stuart Holloway's work helped me immensely too. :P

11:59 Hun: hmm... maybe i can get a jvm to run on my avr. then i could do embedded clojure :)

12:01 kib2: Does someone here works with Clojure on Windows ? It's really annoying to have to open a console each time to enter the REPL and write (load-file "myscript.clj").

12:02 kotarak: kib2: I do. Working with Vim and Chimp.

12:02 Kerris4: kib2: I use enclojure, a NetBeans plugin http://enclojure.net/GettingStarted.html

12:02 kib2: kotarak: interesting, what's Chimp exactly ?

12:02 Hun: kib2: me with emacs and slime. works fine

12:03 kib2: Kerris4: yep, I've installed it too, but my scripts are 10 lines long at the moment and launching NetBeans takes a while !

12:03 kotarak: kib2: it uses screen to talk to the REPL. But it's one street. But I'm working on Gorilla, which will also provide information back to vim. eg. for doc lookup

12:03 kib2: Chimp also needs Cygwin...

12:04 kib2: kotarak: I have Cygwin installed two : where can I find Chimp ?

12:04 kotarak: kib2: www.vim.org, search for chimp in the scripts.

12:05 kib2: Hun: can you show me how you configured emacs to work with Clojure ?

12:05 kotarak: ok, I'll search : thanks for the tips

12:05 Hun: get swank-clojure and the newest slime-dev

12:09 kib2: Hun: thanks, I've got it

12:09 Hun: watch the slime video

12:09 it's for CL, but a lot of this stuff works for clojure, too

12:10 danlarkin: Bill Clementson's got some good instructions on setting up slime for clojure -- http://bc.tech.coop/blog/081023.html

12:10 Hun: i haven't found a solution for java documentation that i'm happy with yet, but it's pretty usable overall

12:12 kotarak: Hun: where can I get a copy? All links refer to the same dead one.

12:13 kib2: Hun : seems very interesting, thanks !

12:15 Hun: i saw one at cliki some time ago. i don't think i have it lying around...

12:17 kotarak: i found it

12:17 do you have 150M webspace lying around?

12:26 duck1123: where do you guys reccomend for webspace?

12:26 I need it to be cheap right now

12:26 danlarkin: I like webfaction.com a lot

12:28 duck1123: what would it take to get clojure-mode working with semantic? any emacs hackers in here?

12:28 kib2: Sorry, I'm not from the Java world : how do I compile Clojure SVN with ant ?

12:28 duck1123: jjust ant

12:28 you cd into the directory, and just type ant

12:29 the default is to build clojure

12:34 kib2: duck1123: wich directory, the 'trunk' one?

12:35 danlarkin: java.lang.OutOfMemoryError: Java heap space

12:36 that's annoying... the jvm won't grow as needed... :-/

12:52 duck1123: um yeah, if you checked out the trunk

12:59 can you destructuring bind hashmaps?

13:00 like how common lisp has it?

13:00 kotarak: duck1123: let [{:key a b c} {:a 1 :b 2 :c 4}] ...)

13:00 :keys

13:00 Similiar with :syms

13:01 duck1123: thanks. does that also work with defn?

13:01 kotarak: I think so, but haven't tried, yet.

13:02 more info is in the let section of http://clojure.org/special_forms

13:55 Lau_of_DK: Anybody remember the command to echo the classpath from clojure-repl ?

13:56 sohail: Lau_of_DK, I use (.getProperty System "java.class.path") I think

13:56 or is it java.lang.path

14:00 Lau_of_DK: I used (.. System (getProperty "java.class.path")), but thanks for the tip, you set me on the path

14:00 danlarkin: I suppose it "should" be written as (System/getProperty "java.class.path")

14:01 Lau_of_DK: Youre right

14:01 ...so now we are sworn enemies

14:01 danlarkin: :-o

14:01 Lau_of_DK: :)

14:04 What happend to the old :uses, is that now just another import?

17:07 danlarkin: I'm having trouble with JSwat, I get a NullPointerException when I start it up -- version 3.61 on OS X. Any ideas? :)

17:11 aperotte: hello everyone, wanted to know if anyone knows whether it's possible to tab-complete java class names from within swank/slime in emacs

17:38 Lau_of_DK: Anybody here done some SqlLite from Clojure ?

18:07 kotarak: For the vimming part of the community: a little teaser for an improvement of Chimp: Gorilla - http://www.screencast-o-matic.com/watch/cjXn2Nnog

18:16 Chousuke: looks cool. that doesn't use any weird screen trickery?

18:17 kotarak: no. But Ruby. :/ Vim is too limited otherwise.

18:17 Chousuke: well that's acceptable I guess

18:17 kotarak: Better than Cygwin on Windows. :)

18:18 And all my vims (MacVim and the Windows one) come with Ruby enabled. So I guess it shouldn't much trouble.

18:19 Chousuke: I'm using aquamacs for clojure stuff mostly because the lisp interaction is a lot better

18:19 kotarak: Im working on changing that. ;)

18:19 Chousuke: That's good to hear.

18:25 adymo: hey, did someone tried to use clojure's Compiler from inside jruby program?

18:26 i've tried but i couldn't load the clojure.lang.Compiler class (http://rafb.net/p/aGB5cw31.html)... at the same time Repl loads fine

18:42 danlarkin: So I've got more path questions... I've got baz.clj in foo/bar/baz/ with (ns foo.bar.baz) at the top. If I want to add a new file like baz-helper.clj can I put that in foo/bar/baz/ too? or must it be in foo/bar/baz-helper/baz-helper.clj

18:56 Ok I figured it out, I put it in foo/bar/baz/baz_helper/baz_helper.clj

18:58 raul: hi

19:03 danlarkin: raul: hi

20:41 I'm missing something obvious, I know, but what's the higher-order way to apply a function that takes one argument to each of the items in a list and just throw away the output

20:41 (I'm dealing with a java object so it has side effects)

20:52 rhickey: danlarkin: (dorun (map f items))

20:54 danlarkin: rhickey: ah of course. thanks :)

21:25 heh, I wish jswat would work for me... I want to know what's causing my java.lang.OutOfMemoryError: Java heap space

Logging service provided by n01se.net