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
something slightly different to* "when not", despite being
functionally identical? And is the distinction important enough to
justify a move towards a confusing Rubyesque undergrowth of equivalent
syntactic sugar?
Probably not, although `unless` is really no different to `when`: they
both eventually expand into `if` forms. I'm not entirely sure where
the line should be drawn, or why I draw it where I do...
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 was soon corrected :)
-R
* Read as "than" if you grew up with American English grammatical
structures! Ah, language.
--
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 email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en