Rich Hickey's presentation which received a standing ovation from Dr. Sussman.
Name:
Anonymous2011-10-22 14:42
How would you do this efficiently in a purely functional way? It's for simplifying a multiplication.
; Not tested, but I hope you get the idea.
(let ((vars nil)
(consts nil))
(dolist (x terms `(* ,@vars ,(apply #'* consts)))
; AIF is the anaphoric if macro.
; CONST tries to coerce its parameter into a constant number and returns NIL if it can't.
(aif (const x)
(if (zerop it)
(return 0)
(push it consts))
(push x vars))))