Re: ANN: Swiss Arrows

2012-04-02 Thread Roman Perepelitsa
lt;>}) IllegalArgumentException No value supplied for key: 2 clojure.lang.PersistentHashMap.createWithCheck (PersistentHashMap.java:89) Roman Perepelitsa. 2012/4/2 Roman Perepelitsa > Looks very nice! > > Is the following behavior expected with Clojure 1.3? > > user=> (-<> 0 '(<

Re: ANN: Swiss Arrows

2012-04-02 Thread Roman Perepelitsa
uess this one is expected, although it would be nice if it worked. user=> (-<> 0 '(1 (1 <>))) (1 (1 <>) 0) Roman Perepelitsa. 2012/4/2 Robert Levy > Swiss arrows is a library I wrote today, providing a number of useful > arrow macros. > >- The Diamond

Re: need hint for "A nil key " on 4clojure

2012-02-29 Thread Roman Perepelitsa
Most 4clojure exercises are meant for you to familiarize yourself with the clojure standard library. Usually you'll spend more time looking for the appropriate function on clojuredocs than actually coding the solution. Here's the section on collections: http://clojuredocs.org/quickref/Clojure%20Co

Re: Creating parsers in clojure

2012-02-03 Thread Roman Perepelitsa
ck out this recent thread: https://groups.google.com/d/topic/clojure/2fGNugcdkDo/discussion Roman Perepelitsa. -- 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 memb

Re: Looking for parser generator library

2012-01-29 Thread Roman Perepelitsa
Thanks for all the suggestions! They'll keep me going for a weekend. Roman Perepelitsa. -- 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 member

Re: Looking for parser generator library

2012-01-28 Thread Roman Perepelitsa
en? > > https://github.com/richard-lyman/amotoen > > I'm not sure what your needs are... > > -Rich > > > > On Sat, Jan 28, 2012 at 8:19 AM, Roman Perepelitsa > wrote: > > I'm looking for a parser generator library. I stumbled upon fnparse, but >

Looking for parser generator library

2012-01-28 Thread Roman Perepelitsa
I'm looking for a parser generator library. I stumbled upon fnparse, but unfortunately it doesn't work with clojure 1.3. Roman Perepelitsa. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloj

Re: problems with if

2012-01-27 Thread Roman Perepelitsa
2012/1/26 raschedh > (if true "t" f) > > in a fresh REPL, I get the error > > [...] Unable to resolve symbol: f [...] > > In common lisp, for example: > > (if t "t" f) > evaluates to "t". Try (if t "t" blah) in common lisp,

Re: problems with if

2012-01-27 Thread Roman Perepelitsa
2012/1/27 Roman Perepelitsa > Try (if t "t" blah) in common lisp, you'll get the same error. > I just tried it and it resolves to "t" in Common Lisp. Sorry about that :-/ Cedric's reply is the one you are looking for. Roman Perepelitsa. -- You r

Re: Rebinding a recursive function

2011-12-02 Thread Roman Perepelitsa
2011/12/1 Stuart Sierra > > Do I understand correct that the only way to hook > > a recursive function without affecting other > > threads is to annotate the function with > > ^{:dynamic true} and call it via #'fact? > > If you want to you dynamic rebinding, yes. > > There are other possibilities

Re: Rebinding a recursive function

2011-12-01 Thread Roman Perepelitsa
Thanks for the reply, Nils. 2011/12/1 Nils Bertschinger > Hi Roman, > > as far as I understand, the Clojure compiler is doing some > optimizations for recursive functions to save the variable lookup. > This means that you have to explicitly write the recursive call as > (#'fact (dec n)) if you w

Re: The Clojure way to solve this problem?

2011-12-01 Thread Roman Perepelitsa
2011/12/1 Baishampayan Ghose > > I think you should look at the binding function - > > http://clojuredocs.org/clojure_core/clojure.core/binding > > > > In my tests, I am using this to run the same tests using two different > > functions, which are supposed to do the same thing (using two differen

[newbie] Rebinding a recursive function

2011-11-30 Thread Roman Perepelitsa
Hello, I'm trying to intercept each call to a recursive function in order to insert logging. It works on the first invocation but not on others. What am I missing? (defn fact [n] (if (< n 2) 1 (* n (fact (dec n) ; Given function f, returns another function that ; does the same as f