#clojure logs

2008-11-02

01:06asbjxrnIs anyone using any profiling tools they can recommend?
03:57Lau_of_DKMorning guys
04:14Kerris4morning Lau_of_DK
04:20Lau_of_DKI 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 ?
04:43cgrandLau_of_DK: did you try to add / to the classpath?
04:43Lau_of_DKYes
04:44Lau_of_DK(btw. Welcome back from holiday cgrand, hope you had a good one)
04:57cgrandno idea then :-(
08:13tomppaIs 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
08:13Chouserassoc-in
08:15tomppathat 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
08:15Chouserthere's also update-in
08:19tomppaThanks, I'll have to play with those
09:26rhickeyhttp://thediscoblog.com/2008/11/02/poll-javas-2008-memorable-moment/
09:27duck1123voted
09:28Chouserheh, results seem a little skewed
09:29kotarakhehe
11:46kib2Hi, stupid question but why when I type (1 2 3) in the REPL do I get an error ?
11:47Kerris4what is the expected output, kib2?
11:47kib2(1 2 3) like in Lisp
11:48kib2sorry, I though it was. But it raises an error too.
11:49kib2because it's not a function
11:50Hunthat's because 1 is (usually) not a function
11:50vyHi! How can I get a list of all available symbols (functions, variables, macros, etc.) in a specific namespace?
11:51danlarkinkib2: if you want the literal list (1 2 3) you can type '(1 2 3)
11:51kib2danlarkin: yes, I must escape the eveluation, that's it ?
11:52danlarkinkib2: yup
11:52danlarkinkib2: (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:53kib2a thing I cannot understand well at the moment is how to deal with global variables.
11:53kib2danlarkin: yes, thanks.
11:54Hunwhat's the problem with globals?
11:55kib2Hun : 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:55Chouservy: (ns-publics 'clojure)
11:56Hunthose are special (aka dynamic) variables
11:56Hunwhich can be dynamically rebound
11:56Huniirc there's bind or binding in clojure (have no repl at this machine)
11:57Kerris4kib2: you might be interested in Stuart Holloway's port of the Practical Common Lisp code samples to Clojure
11:57Kerris4http://blog.thinkrelevance.com/2008/9/16/pcl-clojure
11:57vyChouser: Thanks.
11:58kib2yes, 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:58kib2Kerris4: really nice, thanks !
11:59Kerris4You're welcome, I'm new to both Lisp and Clojure and Stuart Holloway's work helped me immensely too. :P
11:59Hunhmm... maybe i can get a jvm to run on my avr. then i could do embedded clojure :)
12:01kib2Does 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:02kotarakkib2: I do. Working with Vim and Chimp.
12:02Kerris4kib2: I use enclojure, a NetBeans plugin http://enclojure.net/GettingStarted.html
12:02kib2kotarak: interesting, what's Chimp exactly ?
12:02Hunkib2: me with emacs and slime. works fine
12:03kib2Kerris4: yep, I've installed it too, but my scripts are 10 lines long at the moment and launching NetBeans takes a while !
12:03kotarakkib2: 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:03kotarakkib2: Chimp also needs Cygwin...
12:04kib2kotarak: I have Cygwin installed two : where can I find Chimp ?
12:04kotarakkib2: www.vim.org, search for chimp in the scripts.
12:05kib2Hun: can you show me how you configured emacs to work with Clojure ?
12:05kib2kotarak: ok, I'll search : thanks for the tips
12:05Hunget swank-clojure and the newest slime-dev
12:09kib2Hun: thanks, I've got it
12:09Hunwatch the slime video
12:09Hunit's for CL, but a lot of this stuff works for clojure, too
12:10danlarkinBill Clementson's got some good instructions on setting up slime for clojure -- http://bc.tech.coop/blog/081023.html
12:10Huni haven't found a solution for java documentation that i'm happy with yet, but it's pretty usable overall
12:12kotarakHun: where can I get a copy? All links refer to the same dead one.
12:13kib2Hun : seems very interesting, thanks !
12:15Huni saw one at cliki some time ago. i don't think i have it lying around...
12:17Hunkotarak: i found it
12:17Hundo you have 150M webspace lying around?
12:26duck1123where do you guys reccomend for webspace?
12:26duck1123I need it to be cheap right now
12:26danlarkinI like webfaction.com a lot
12:28duck1123what would it take to get clojure-mode working with semantic? any emacs hackers in here?
12:28kib2Sorry, I'm not from the Java world : how do I compile Clojure SVN with ant ?
12:28duck1123jjust ant
12:28duck1123you cd into the directory, and just type ant
12:29duck1123the default is to build clojure
12:34kib2duck1123: wich directory, the 'trunk' one?
12:35danlarkinjava.lang.OutOfMemoryError: Java heap space
12:36danlarkinthat's annoying... the jvm won't grow as needed... :-/
12:52duck1123um yeah, if you checked out the trunk
12:59duck1123can you destructuring bind hashmaps?
13:00duck1123like how common lisp has it?
13:00kotarakduck1123: let [{:key a b c} {:a 1 :b 2 :c 4}] ...)
13:00kotarak:keys
13:00kotarakSimiliar with :syms
13:01duck1123thanks. does that also work with defn?
13:01kotarakI think so, but haven't tried, yet.
13:02kotarakmore info is in the let section of http://clojure.org/special_forms
13:55Lau_of_DKAnybody remember the command to echo the classpath from clojure-repl ?
13:56sohailLau_of_DK, I use (.getProperty System "java.class.path") I think
13:56sohailor is it java.lang.path
14:00Lau_of_DKI used (.. System (getProperty "java.class.path")), but thanks for the tip, you set me on the path
14:00danlarkinI suppose it "should" be written as (System/getProperty "java.class.path")
14:01Lau_of_DKYoure right
14:01Lau_of_DK...so now we are sworn enemies
14:01danlarkin:-o
14:01Lau_of_DK:)
14:04Lau_of_DKWhat happend to the old :uses, is that now just another import?
17:07danlarkinI'm having trouble with JSwat, I get a NullPointerException when I start it up -- version 3.61 on OS X. Any ideas? :)
17:11aperottehello everyone, wanted to know if anyone knows whether it's possible to tab-complete java class names from within swank/slime in emacs
17:38Lau_of_DKAnybody here done some SqlLite from Clojure ?
18:07kotarakFor the vimming part of the community: a little teaser for an improvement of Chimp: Gorilla - http://www.screencast-o-matic.com/watch/cjXn2Nnog
18:16Chousukelooks cool. that doesn't use any weird screen trickery?
18:17kotarakno. But Ruby. :/ Vim is too limited otherwise.
18:17Chousukewell that's acceptable I guess
18:17kotarakBetter than Cygwin on Windows. :)
18:18kotarakAnd all my vims (MacVim and the Windows one) come with Ruby enabled. So I guess it shouldn't much trouble.
18:19ChousukeI'm using aquamacs for clojure stuff mostly because the lisp interaction is a lot better
18:19kotarakIm working on changing that. ;)
18:19ChousukeThat's good to hear.
18:25adymohey, did someone tried to use clojure's Compiler from inside jruby program?
18:26adymoi'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:42danlarkinSo 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:56danlarkinOk I figured it out, I put it in foo/bar/baz/baz_helper/baz_helper.clj
18:58raulhi
19:03danlarkinraul: hi
20:41danlarkinI'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:41danlarkin(I'm dealing with a java object so it has side effects)
20:52rhickeydanlarkin: (dorun (map f items))
20:54danlarkinrhickey: ah of course. thanks :)
21:25danlarkinheh, I wish jswat would work for me... I want to know what's causing my java.lang.OutOfMemoryError: Java heap space