Re: Rebinding vars at compile time

2010-03-07 Thread Konrad Hinsen
On 7 Mar 2010, at 21:03, Benjamin Teuber wrote: Another idea would be to alter the root binding of *assert* instead. I guess this solution would work for your own vars, but unfortunately it is not possible to do this with *assert*: (def *assert* false) You cannot use def to change the value o

Re: I confused myself. How can I solve this simple problem?

2010-03-07 Thread Stephen C. Gilardi
On Mar 7, 2010, at 10:57 PM, CuppoJava wrote: > Is there an elegant solution to this problem? I'm working around it by > saving the original println in another variable before creating > myprintln, but this isn't very clean. In case by another "variable", you were referring to another "var": One

Re: I confused myself. How can I solve this simple problem?

2010-03-07 Thread Phil Hagelberg
On Sun, Mar 7, 2010 at 7:57 PM, CuppoJava wrote: > Is there an elegant solution to this problem? I'm working around it by > saving the original println in another variable before creating > myprintln, but this isn't very clean. That's what I generally do, but you could use a let instead: (let [o

I confused myself. How can I solve this simple problem?

2010-03-07 Thread CuppoJava
So I just stumbled across this bug in my code, and it arose very innocently so I wonder if anyone has an elegant solution to this problem. There is already a function called (println). Now I would like to write another version of it, which just tacks some stuff at the end of what it normally does

Re: Rebinding vars at compile time

2010-03-07 Thread CuppoJava
I agree that the issue with not being to change the root value of *assert* seems odd. But I actually like the macroexpand-all solution. It's done at compile- time, so performance is not a big problem, and clojure's macroexpand resolves everything to the proper namespace anyway. -Patrick -- Yo

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-07 Thread Phil Hagelberg
On Sun, Mar 7, 2010 at 7:57 AM, Mike K wrote: > On Mar 4, 4:32 pm, Glen Stampoultzis wrote: >> >> Getting swank-clojure going in Windows is also a pain.  To install it the >> recommended way via ELPA you need to patch the ELPA source code first.  This >> isn't documented at the swank-clojure site

Re: clojure slides

2010-03-07 Thread Wilson MacGyver
thank you very much, looking through it now! On Sat, Mar 6, 2010 at 6:02 PM, Tom Hicks wrote: > PDF of slides from my presentation at a recent Tucson JUG: > http://tinyurl.com/yjrnh55 > (licensed as Creative Commons Attribution-Noncommercial). If you need > the > Powerpoint email me. >    regards

Defn-memo doesn't work for recursive functions

2010-03-07 Thread André Ferreira
;Simple example (defn fib1 [n] (if (or (= 0 n) (= 1 n)) 1 (+ (fib1 (- n 1)) (fib1 (- n 2) (defn-memo fib2 [n] (if (or (= 0 n) (= 1 n)) 1 (+ (fib2 (- n 1)) (fib2 (- n 2) ;workaround for this problem (declare aux-fib) (defn-memo fib3 [n] (if (or (= 0 n) (=

Re: clojure slides

2010-03-07 Thread Baishampayan Ghose
> Re: Emacs + Slime + paredit. I did not see Clojure listed as supported > for Slime and paredit. Do you know if: > > - AquaEmacs (mac) is a shoe-in? Works with Carbon Emacs on the Mac. Should work with AquaEmacs too. > - Can you do all Slime stuff in Clojure? evaluate, macro-expand, docs, > etc?

Rebinding vars at compile time

2010-03-07 Thread Benjamin Teuber
Hi! Yesterday on IRC some of us were struggling with the usage of dynamically rebound vars inside macros which led to interesting compile vs run time issues. I've got some questions for the experts at the very bottom of this post - but before I'd like to explai this issue for the less experienced

building clojure from scratch

2010-03-07 Thread cageface
Takes 15 seconds on my i7 laptop. Gotta love it. -- 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 Note that posts from new members are moderated - please be patient with your first post. To

jrclj: library for calling clojure from JRuby

2010-03-07 Thread Kyle R. Burton
Hello, We've been using Clojure and JRuby on a project at work. For that project we've got libraries we implemented in clojure and an application in JRuby - so that we can call the clojure libraries from the JRuby code I wrote a library, JRClj, to make api easier to deal with. The project is ins

Re: enclojure install killed netbeans 6.8

2010-03-07 Thread Mark Nutter
On Fri, Mar 5, 2010 at 11:34 PM, strattonbrazil wrote: > Has anyone had problems with netbeans starting with the enclojure > alpha?  I restarted my session and it died.  Now when I try to run > netbeans, it throws a classpath exception.  Can I remove this plugin > or am I missing something in my i

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-07 Thread Mark Nutter
On Sun, Mar 7, 2010 at 10:40 AM, Meikel Brandmeyer wrote: > So your point boils down to emacs and lein don't work on Windows. I > don't know about emacs, but at least for leiningen there is some > activity at that front (cf. Rob's response). > > So I still think: if you have trouble with clojure

Re: REPL in a browser

2010-03-07 Thread Angel Java Lopez
There is a Clojure REPL in a browser implementation I know: http://lotrepls.appspot.com/ Project home http://code.google.com/p/lotrepls/ They support - beanshell * - clojure - groovy * - javascript * - python * - ruby * - scala * - scheme using Google App Engine as back

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-07 Thread Mike K
Is anyone familiar with running Maven (and possibly Polygot Maven) on Windows? Does it pretty much work as expected? The learning curve for Maven looks steeper than for Leiningen, but if it makes up for it with better documentation and being better-behaved, then it may be worth it. Mike --

REPL in a browser

2010-03-07 Thread Jozef Wagner
Hi, I'm wondering how hard it would be to make a clojure REPL accessible from a browser. Something like at http://www.simplyscala.com/ Some approaches I have thought of: a) Java Applet Downsides: need to have Java 1.6 enabled in a browser, less cool visual presentation :) Upsides (for some): Runn

Meta for method definitions

2010-03-07 Thread Terje Norderhaug
What is a good way to get the :file and :line meta information for a method? Getting this meta information for a multi is straight forward: (meta #'clojure.core/print-method) => {:ns #, :name print-method, :file "clojure/ core.clj", :line 2314, :tag clojure.lang.MultiFn} But what about gett

Re: clojure slides

2010-03-07 Thread Sophie
Re: Emacs + Slime + paredit. I did not see Clojure listed as supported for Slime and paredit. Do you know if: - AquaEmacs (mac) is a shoe-in? - Can you do all Slime stuff in Clojure? evaluate, macro-expand, docs, etc? - Same for par-edit Thanks! On Mar 4, 1:56 pm, Baishampayan Ghose wrote: > Wi

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-07 Thread Mike K
On Mar 4, 4:32 pm, Glen Stampoultzis wrote: > > Getting swank-clojure going in Windows is also a pain.  To install it the > recommended way via ELPA you need to patch the ELPA source code first.  This > isn't documented at the swank-clojure site either. For others who are struggling with this iss

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-07 Thread Meikel Brandmeyer
Hi, On Mon, Mar 08, 2010 at 01:44:44AM +1100, Glen Stampoultzis wrote: > It seems (from my limited observations) that most of the Clojure developers > are Linux/Mac people so it's understandable that Windows isn't currently as > well supported by all tools. Windows has a fairly big share, I thin

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-07 Thread Glen Stampoultzis
On 5 March 2010 17:22, Meikel Brandmeyer wrote: > Hi, > > On Mar 5, 1:03 am, Felix Breuer wrote: > > > I agree that Windows is a second class citizen as far as clojure > > tools go. > > Oh please stop that. I have a stable setup of Gradle + Clojuresque + > VimClojure on Windows. Granted setting

Re: Default value for structure

2010-03-07 Thread Manfred Lotz
On Sun, 7 Mar 2010 12:35:27 +0800 Mike Mazur wrote: > Hi, > > On Sat, Mar 6, 2010 at 20:36, Manfred Lotz > wrote: > > Now I tried a different way: > > > > (defstruct st :a :b) > > > > (defn my-struct-map [s & inits] > >  (let [sm (struct-map s inits)] > >    (if (= nil (sm :b)) > >      (assoc

Re: Default value for structure

2010-03-07 Thread b2m
Hi, depending on your application you might use defnk (http:// richhickey.github.com/clojure-contrib/def-api.html#clojure.contrib.def/ defnk) to build your struct with default values. Benjamin -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post