Re: My SLIME installation diary

2009-02-09 Thread bOR_
HI Phil. Tried the clojure-install on a fairly clean ubuntu / emacs23 Here is what went and what went wrong: Had to use a different .emacs. Just autoload and add-to-list didn't seem to load clojure-mode.el. Took a moment to figure out that I had to set clojure-src-root as well, as that isn't

Re: My SLIME installation diary

2009-02-09 Thread bOR_
Slowly wrestling myself through getting to know emacs. Ok. autoload works fine. Didn't realize I have to open emacs with a .clj file for the clojure-mode to load. Now looking where this 'Cannot open load file:slime-repl' is coming from. On Feb 9, 10:36 am, bOR_ boris.sch...@gmail.com wrote: HI

Re: if-let

2009-02-09 Thread jdz
(let [basedir (if-let [bdir (:basedir *locs)] bdir .)]     ...) I'd personally write that as: (let [basedir (or (:basedir *locs*) .)] ...) There is also when-let, which can be used to iterate over sequences: (loop [items some-sequence] (when-let [item (first items)] (do something)

Re: Datalog update

2009-02-09 Thread Rich Hickey
Looks like you're moving apace! Have you considered query/subquery optimization instead of magic sets? Rich On Feb 8, 7:51 pm, Jeffrey Straszheim straszheimjeff...@gmail.com wrote: By the way, if anyone on this list has experience implementing bottom-up optimizations for logic programs,

Re: Minor bug report: (merge-with f) returns nil, not {}

2009-02-09 Thread Rich Hickey
On Sat, Feb 7, 2009 at 9:16 PM, Jason Wolfe jawo...@berkeley.edu wrote: merge-with says it returns a map, but if you give it no arguments it gives you back nil instead of the empty map. In my code, I had something like: ((apply merge-with concat maps) key) and got NPE rather than nil

Clojure + Slick - stylistic questions

2009-02-09 Thread phtrivier
Hi everyone first of all, this is my first post, so if I ask FAQs or deserve to RTFM, please tell me. I am learning clojure, and trying to adapt some game code written in a Java framework called Slick. After a couple of beginner's mistake (the kind you do to learn ;) ), I got a working

Re: Am I holding on to the head here ?

2009-02-09 Thread Jeffrey Straszheim
Cool, thanks. On Mon, Feb 9, 2009 at 7:14 AM, Rich Hickey richhic...@gmail.com wrote: On Feb 8, 5:13 pm, Jeffrey Straszheim straszheimjeff...@gmail.com wrote: I have this piece of code: (defn- run-work-elements-in-parallel Runs a group of work elements in parallel. Returns an

Re: Datalog update

2009-02-09 Thread Jeffrey Straszheim
No, but I'm really learning as I go here. I'll look into it. On Mon, Feb 9, 2009 at 7:58 AM, Rich Hickey richhic...@gmail.com wrote: Looks like you're moving apace! Have you considered query/subquery optimization instead of magic sets? Rich On Feb 8, 7:51 pm, Jeffrey Straszheim

Re: Stack overflow problem

2009-02-09 Thread Jeffrey Straszheim
Did this work for you? Do you understand what the problem was? On Sun, Feb 8, 2009 at 8:06 PM, Jeffrey Straszheim straszheimjeff...@gmail.com wrote: In fact, try this: (defn add-children [searchtype statelist] (let [c (children (first statelist)) s (rest statelist)]

Re: Clojure + Slick - stylistic questions

2009-02-09 Thread Laurent PETIT
Since you say you're an Eclipse user, one answer could be : use clojuredev (eclipse plugin supporting clojure development), and wait patiently for this feature to be included :-). More seriously : clojuredev, while still a baby compared to slime, has some interesting features worth considering

Re: Clojure + Slick - stylistic questions

2009-02-09 Thread Laurent PETIT
I wanted to say compared to emacs+slime+clojure-swank, of course. There are also netbeans and jetbrain Ideas implementations, also. I just posted here because you told about eclipse, but those other environments are good, too ! -- Laurent 2009/2/9 Laurent PETIT laurent.pe...@gmail.com Since

Curious about Cells

2009-02-09 Thread Jeffrey Straszheim
I know I could just go read the docs, but I hope someone familiar with this Cells stuff could save me some time: 1. Does Cells handle circular dependencies in your computation? If so, (briefly) how? (e.g. if the value of X depends on Y, and Y depends on X, can it handle it?) 2. How is state

Re: pmap issues

2009-02-09 Thread Rich Hickey
On Feb 7, 9:36 pm, Jeffrey Straszheim straszheimjeff...@gmail.com wrote: With the help of the IRC folks I solved my own problem. I thought I'd share my findings: You cannot safely call pmap inside of another pmap function. Because pmap is implemented on top of agents, the actual calls to

Re: pmap issues

2009-02-09 Thread Jeffrey Straszheim
Good. This one concerned me, as I'd like to use pmap given its simplicity, but that would prevent other from calling my code in their own pmap (and how would they know not to do that). On Mon, Feb 9, 2009 at 11:29 AM, Rich Hickey richhic...@gmail.com wrote: On Feb 7, 9:36 pm, Jeffrey

Re: Clojure + Slick - stylistic questions

2009-02-09 Thread phtrivier
Oh, don't worry, I used clojuredev for this ;) I noticed a few bugs here and there, by the way, so i'll have to find some time and report / patch ... anyway on this topic you really have the same probleme with java, except that propers tools just hide the hugly list of import anyway. Cheers PH

Re: Clojure + Slick - stylistic questions

2009-02-09 Thread phtrivier
Oh, don't worry, I used clojuredev for this ;) I noticed a few bugs here and there, by the way, so i'll have to find some time and report / patch ... anyway on this topic you really have the same probleme with java, except that propers tools just hide the hugly list of import anyway. Cheers PH

building a class or jar file from clojure

2009-02-09 Thread hank williams
How does one make a standard clojure based class file or jar file without embedding clojure source files. Hank -- blog: whydoeseverythingsuck.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To

Re: Clojure + Slick - stylistic questions

2009-02-09 Thread Matt Clark
I agree with what Laurent said about clojuredev, I've been having great success using it myself, for my clojure/slick creations. My first project was converting Kevin Glass's platformer example over to clojure which gave me a chance to learn slick and Clojure all in one go! Unfortunately, the

Re: Clojure + Slick - stylistic questions

2009-02-09 Thread Laurent PETIT
Oh nice ! So there's more clojuredev users than the ones having subscribed to the clojuredev-user ml :-) Feel free to report bugs. I like them :-) Correcting a bug is like a step forward to perfection :-) :-) -- Laurent 2009/2/9 phtrivier phtriv...@gmail.com Oh, don't worry, I used

Re: building a class or jar file from clojure

2009-02-09 Thread Joshua Fox
Ahead of Time compilation might be what you are looking for . This lets you distribute.class files rather than your .clj source files, and makes for slightly faster code at startup. http://groups.google.com/group/clojure/msg/58e3f8e5dfb876c9 Joshua On Mon, Feb 9, 2009 at 6:52 PM, hank williams

Re: building a class or jar file from clojure

2009-02-09 Thread Meikel Brandmeyer
Hi, Am 09.02.2009 um 17:52 schrieb hank williams: How does one make a standard clojure based class file or jar file without embedding clojure source files. http://clojure.org/compilation You might want to read also the other items on the left hand side in the reference section. Sincerely

Fwd: Patch: universal main() with repl/script/compile

2009-02-09 Thread Thorsen Eric
For some reason I could not reply to the original thread... Begin forwarded message: From: Stephen C. Gilardi squee...@mac.com Date: February 6, 2009 12:49:34 PM EST To: Eric Thorsen ethor...@enclojure.org Subject: Re: Patch: universal main() with repl/script/compile Hi Eric, I've been

Re: Fwd: Patch: universal main() with repl/script/compile

2009-02-09 Thread Rich Hickey
On Feb 9, 2:10 pm, Thorsen Eric ethor...@enclojure.org wrote: For some reason I could not reply to the original thread... Begin forwarded message: From: Stephen C. Gilardi squee...@mac.com Date: February 6, 2009 12:49:34 PM EST To: Eric Thorsen ethor...@enclojure.org Subject: Re:

Re: My SLIME installation diary

2009-02-09 Thread bOR_
Thanks for all the explanations. I'll try again this wednesday! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this

Re: building a class or jar file from clojure

2009-02-09 Thread prhlava
Hello hank, How does one make a standard clojure based class file or jar file without embedding clojure source files. Shameful plug: http://en.wikibooks.org/wiki/Clojure_Programming/Tutorials_and_Tips#Distributing_application_as_self_contained_.jar (the above URL should be 1 line..., it

Re: Clojure + Slick - stylistic questions

2009-02-09 Thread Jason Wolfe
I know there is no way to import org.newdawn.slick.* (as discussed here :http://groups.google.com/group/clojure/browse_thread/thread/fa00a0ff4... ). What do you do in programs that need huge list of imports ? I'm kinda spoiled by the Eclipse way of doing this, which is roughly : import

Re: A pipe macro for left-to-right coll streams

2009-02-09 Thread Mark Fredrickson
I like that implementation. The recursive call makes it much cleaner. A slight improvement (?) yet: (defmacro let- Provide a name that will be bound to the result of the first form. For each additional form, the variable will be used in the evaluation, and then rebound to the result

Re: Patch: universal main() with repl/script/compile

2009-02-09 Thread Stephen C. Gilardi
On Feb 9, 2009, at 2:13 PM, Rich Hickey wrote: On Feb 9, 2:10 pm, Thorsen Eric ethor...@enclojure.org wrote: For some reason I could not reply to the original thread... Begin forwarded message: From: Stephen C. Gilardi squee...@mac.com Date: February 6, 2009 12:49:34 PM EST To: Eric

Re: A pipe macro for left-to-right coll streams

2009-02-09 Thread Jason Wolfe
I like that implementation. The recursive call makes it much cleaner. A slight improvement (?) yet: (defmacro let- Provide a name that will be bound to the result of the first form. For each additional form, the variable will be used in the evaluation, and then rebound to the result

unintended consequences of printing

2009-02-09 Thread Chouser
A conversation on IRC tonight[1] got me thinking... Although most collections can be safely printed, such as at the REPL, this is not true of all collections. Probably the best-known exception in Clojure are infinite lazy sequences, where printing can cause an infinite loop: (prn (iterate inc