Re: In core.match, what's the difference between predicates (:when) and guards (:guard)?

2015-12-09 Thread Hunter Kelly
Okay, thanks! On 9 December 2015 at 02:39, David Nolen wrote: > core.match will attempt to optimize matching :when clauses in the decision > tree. > > David > > On Tue, Dec 8, 2015 at 4:18 PM, retnuH wrote: > >> I can't really figure out what the deal

Re: In core.match, what's the difference between predicates (:when) and guards (:guard)?

2015-12-08 Thread David Nolen
core.match will attempt to optimize matching :when clauses in the decision tree. David On Tue, Dec 8, 2015 at 4:18 PM, retnuH wrote: > I can't really figure out what the deal is with predicates. They're not > mentioned in the Basic/Advanced usage wiki pages at all. The code

In core.match, what's the difference between predicates (:when) and guards (:guard)?

2015-12-08 Thread retnuH
I can't really figure out what the deal is with predicates. They're not mentioned in the Basic/Advanced usage wiki pages at all. The code for Guards and Predicates is basically identical. The only difference that I've been able to find (beyond the spelling, obviously): - predicates can only

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

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 evaluate when

Re: difference between if/when

2010-02-28 Thread DanL
Hello! On 28 Feb., 18:08, Аркадий Рост arkr...@gmail.com 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

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

Re: difference between if/when

2010-02-28 Thread Steven E. Harris
Richard Newman holyg...@gmail.com 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: , |

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 communicate

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 to

Re: difference between if/when

2010-02-28 Thread Mike Meyer
On Sun, 28 Feb 2010 14:18:50 -0800 Richard Newman holyg...@gmail.com 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

Re: difference between if/when

2010-02-28 Thread Steven E. Harris
Richard Newman holyg...@gmail.com 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

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