Re: lazy-cat

2009-05-17 Thread Laurent PETIT
2009/5/16 Sean Devlin francoisdev...@gmail.com: I'm sorry, it's an Americanism.  By Dog People, I meant someone that prefers a dog as a pet, not a cat.  It was meant as a joke. OK, I know understand the joke and the play on words :-$ You're right, I should be more considerate of the

Re: error-kit + test-is

2009-05-17 Thread Dan Larkin
Sorry for the necro, but I just started using error-kit and read this thread for the first time today. Both error-kit (errors no longer inherit from *error* AFAICT) and test- is (the report function syntax) have changed since David last posted a working function, so I've updated it work with

Re: Override the + operator for a 'struct'

2009-05-17 Thread Meikel Brandmeyer
Hi, Am 17.05.2009 um 03:43 schrieb bradford cross: First item of business - there are no operators, operators are functions. I think the Clojure way to do this is via multimethods: http://clojure.org/multimethods I might just be naive, but it seems like more of core would need to be

Re: Override the + operator for a 'struct'

2009-05-17 Thread Konrad Hinsen
On 17.05.2009, at 03:43, bradford cross wrote: First item of business - there are no operators, operators are functions. I think the Clojure way to do this is via multimethods: http:// clojure.org/multimethods I might just be naive, but it seems like more of core would need to be

Re: Question about building modular code in Clojure

2009-05-17 Thread Adrian Cuthbertson
Hi Mark, I've used the following macro to achieve something like what you're doing; In the file/namespace module (say eg_globs/fns.clj); (ns eg-globs.fns) (declare *gravity*) (defmacro with-grav [grav body] `(let [gr# ~grav] (binding [*gravity* gr#] ~...@body))) (defn

Re: Question about building modular code in Clojure

2009-05-17 Thread Rich Hickey
On May 16, 10:45 pm, Mark Engelberg mark.engelb...@gmail.com wrote: So I've built a file/namespace with several functions. There are several globals defined at the top of the file (for example, *gravity*) which many of the functions refer to. I made them globals precisely because it would

Re: new Clojure presentation

2009-05-17 Thread Mark Volkmann
On Sat, May 16, 2009 at 12:28 AM, Timothy Pratley timothyprat...@gmail.com wrote: the link at the bottom of the page. Feedback is welcomed! Really excellent Mark! Thanks Tim! -- R. Mark Volkmann Object Computing, Inc. --~--~-~--~~~---~--~~ You received this

Re: list vs vector

2009-05-17 Thread Mark Volkmann
On Fri, May 15, 2009 at 2:36 PM, Vagif Verdi vagif.ve...@gmail.com wrote: What are the use case scenarios where one is preferable to the other in clojure ? A lot of good points have been raised in this thread. A minor point to add is that literal vectors are a bit easier to pick out in code

Re: Classpath problem with r1369 ?

2009-05-17 Thread Paul Mooser
Is anyone having contrary results, or does anyone know of a way to call add-classpath and have it actually work with an up-to-date trunk build of clojure ? This basically breaks my common usage of clojure, because it requires me to pass all class paths to the app upon launching, which isn't

Re: Question about building modular code in Clojure

2009-05-17 Thread Mark Engelberg
Thanks for your questions. I'll try to explain better. First, I'll explain that my line of work is to build tools to generate puzzles. I often have a module which generates the puzzles through various random processes, using certain probabilities and parameters. Then, I have another module

Clojure and Jacob

2009-05-17 Thread janus
Hello All, I can't figure out how to read cells with Jacob. I need a help. Emeka --~--~-~--~~~---~--~~ 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

Re: Clojure and Jacob

2009-05-17 Thread Meikel Brandmeyer
Hi Emeka, Am 17.05.2009 um 21:59 schrieb janus: I can't figure out how to read cells with Jacob. I need a help. I'm totally sorry. I forgot to answer your pm. :| This is the example you quoted. And there you already have the solution. (import '(com.jacob.com Dispatch ComThread)) (def xl

Re: Clojure and Jacob

2009-05-17 Thread Emeka
Meikel (def c (.. Dispatch (call ws Cells 1 1) (toDispatch))) Here you retrieve the actual cell. If I have file hello.xls already and I have say 'Emeka at Cell 1 1, using the above line could I get 'Emeka . Regards, Emeka On Sun, May 17, 2009 at 8:06 PM, Meikel Brandmeyer m...@kotka.de

Re: Override the + operator for a 'struct'

2009-05-17 Thread philip.hazel...@gmail.com
On May 17, 1:14 am, Michel S. michel.syl...@gmail.com wrote: In Clojure, it is possible to do the former -- (def orig+ +) -- but it appears that overriding a clojure.core definition is not possible. I'd love to be wrong on this, though. user= (def + -) java.lang.Exception: Name conflict,

Re: Question about building modular code in Clojure

2009-05-17 Thread mikel
On May 17, 2:24 pm, Mark Engelberg mark.engelb...@gmail.com wrote: Thanks for your questions.  I'll try to explain better. I'm still not quite clear on exactly what you're trying to accomplish. You showed how to accomplish your purpose in Clojure, but then suggested that the result was not

Re: Question about building modular code in Clojure

2009-05-17 Thread Stuart Sierra
Hi Mark, Not sure if this helps, but I've found it useful to mediate access to global vars through a single function. Then I can swap in another function to change the behavior. Here's an example from http://tinyurl.com/qm8pj4 (defn get-property-function [name] (System/getProperty name))

Re: Question about building modular code in Clojure

2009-05-17 Thread Mark Engelberg
On Sun, May 17, 2009 at 2:18 PM, mikel mev...@mac.com wrote: I'm still not quite clear on exactly what you're trying to accomplish. You showed how to accomplish your purpose in Clojure, but then suggested that the result was not 'clean'. It's not quite clear what you mean by 'clean'--that is,

Re: Best practices for Slime with Clojure

2009-05-17 Thread Craig McDaniel
Hi Glen, Everybody seems to have their own approach. I use a run-slime wrapper emacs function discussed here: http://groups.google.com/group/clojure/browse_thread/thread/855804aa6fdd74a1/0969640bc5637bd7) Here is the emacs code I use: (defun reset-swank () Because changing

Re: Override the + operator for a 'struct'

2009-05-17 Thread bradford cross
On Sun, May 17, 2009 at 1:40 PM, philip.hazel...@gmail.com philip.hazel...@gmail.com wrote: On May 17, 1:14 am, Michel S. michel.syl...@gmail.com wrote: In Clojure, it is possible to do the former -- (def orig+ +) -- but it appears that overriding a clojure.core definition is not possible.

Re: Question about building modular code in Clojure

2009-05-17 Thread David Nolen
Have you looked at the immigrate function in Compojure? This imports public vars from a different namespace into a namespace as if they were defined there. Maybe this is enough to get the behavior that you want? On Sun, May 17, 2009 at 9:12 PM, Mark Engelberg mark.engelb...@gmail.comwrote: On

Re: Question about building modular code in Clojure

2009-05-17 Thread Mark Engelberg
On Sun, May 17, 2009 at 8:12 PM, David Nolen dnolen.li...@gmail.com wrote: Have you looked at the immigrate function in Compojure? This imports public vars from a different namespace into a namespace as if they were defined there.  Maybe this is enough to get the behavior that you want? Not

Re: Question about building modular code in Clojure

2009-05-17 Thread David Nolen
Oops your right. Perhaps this will work for you then. ;; gravity.clj (note we don't define an ns) ;; === (def *gravity* 1.0) (defn say-grav [grav] (prn Gravity is: grav)) (defn halve-grav [] (/ *gravity* 2.0)) (defn mult-grav [x] (* *gravity* x))