
Clojure: if-let and when-let - DanielRibeiro
http://blog.jayfields.com/2011/03/clojure-if-let-and-when-let.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+jayfields%2FmjKQ+%28Jay+Fields+Thoughts%29
======
JeanPierre
PG has written about if-let, when-let, while-let and the likes in _On Lisp_ ,
but calls them anaphoric macros instead. They are basically the same macros,
but without the use of bindings (more brevity). You should take a look at it
if you're interested.

<http://lib.store.yahoo.net/lib/paulgraham/onlisp.pdf> \- Chapter 14 -
Anaphoric Macros is on page 189.

~~~
cgrand-net
It's a design choice to value explicit naming (and easier nesting) over
brevity.

Anaphoric macros are not idiomatic in Clojure (there is only one: proxy),
implicit introduction of locals is frowned upon (and you have to fight the
hygienic macro system to create them).

~~~
JeanPierre
Oh, I am by no means against explicit naming. I'm just recommending people to
read chapter 14 of On Lisp if they find if-let and when-let good macros they
use often.

------
pwpwp
AND-LET* is a nice generalization:
<http://srfi.schemers.org/srfi-2/srfi-2.html>

