Re: difference between if/when

2010-02-28 Thread Аркадий Рост
ok. Thanks. -- 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 unsubscribe from this group, send em

Re: difference between if/when

2010-02-28 Thread Steven E. Harris
Richard Newman writes: > Incidentally, I initially didn't know about `when-not` -- I figured > that `unless` had simply been omitted -- so I defined: > > (defmacro unless [pred & body] > `(when (not ~pred) ~...@body)) I did the same, and then was frustrated enough to dig through the core API d

Re: difference between if/when

2010-02-28 Thread Mike Meyer
On Sun, 28 Feb 2010 14:18:50 -0800 Richard Newman wrote: > This is an interesting point, though -- does "unless" communicate > something slightly different to* "when not", despite being > functionally identical? And is the distinction important enough to > justify a move towards a confusing

Re: difference between if/when

2010-02-28 Thread Michał Marczyk
I always thought unless is a very nice name for if-not... I'm beginning to understand why we have if-not / when-not and no unless out of the box. :-) All best, Michał -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email t

Re: difference between if/when

2010-02-28 Thread Richard Newman
I'm still undecided whether to shake this habit: , | (defmacro unless [pred & body] | `(when-not ~pred ~...@body)) ` Heh. I still think that "unless" is a better name than "when-not", but I've migrated pretty easily. This is an interesting point, though -- does "unless" communicat

Re: difference between if/when

2010-02-28 Thread Steven E. Harris
Richard Newman writes: > There are more subtle clues that you'll pick up in certain people's > styles, too -- I'm sure my use of when has a very different pattern to > a Java guy's, colored by my Common Lisp experience. I'm still undecided whether to shake this habit: , | (defmacro unless [

Re: difference between if/when

2010-02-28 Thread Richard Newman
hmm...I don't understand why clojure when and if simultaneously? What is the diffirences between them and when I should use one instead another one? Disregarding all of the practical benefits (such as an implicit do): languages often incorporate apparently redundant constructs because one of

Re: difference between if/when

2010-02-28 Thread DanL
Hello! On 28 Feb., 18:08, Аркадий Рост wrote: > Hi! > > hmm...I don't understand why clojure when and if simultaneously? What > is the diffirences between them and when I should use one instead > another one? Besides the implicit do, which reynard mentioned, it's generally idiomatic to use while

Re: difference between if/when

2010-02-28 Thread reynard
user> (when true (println "line 1") (println "line 2") (println "line 3") (println "there is no need to use #'do") (println "there is nothing to evaluate when false and return nil")) line 1 line 2 line 3 there is no need to use #'do there is nothing to evalua

difference between if/when

2010-02-28 Thread Аркадий Рост
Hi! hmm...I don't understand why clojure when and if simultaneously? What is the diffirences between them and when I should use one instead another one? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@goog