Christophe Turle <cturle@nospam.fr> wrote:
+---------------
| Example : You will gain lots of time teaching your system that (and (> x
| y) (<= x y)) is always false. This is meta-knowledge. And macros allow
| you to implement this knowledge. Imagine f is a very expensive function.
|
| (macroexpand-1 '(and+ (<= (f) 1) (> (f) 1)))
| => nil ; so (f) will never be evaluated !!!
+---------------
CAREFUL!! Doing this sort of optimization correctly is harder
than it initially appears. What if F is stateful, or does I/O,
or is in *ANY* way not purely functional? Then you've broken
the semantics!!
-Rob
-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607