0.6.11.28:
[sbcl.git] / src / code / early-extensions.lisp
index 4834c06..0d40d30 100644 (file)
   (if (consp x)
       (destructuring-bind (result) x result)
       x))
+
+;;; some commonly-occuring CONSTANTLY forms
+(macrolet ((def-constantly-fun (name constant-expr)
+            `(setf (symbol-function ',name)
+                   (constantly ,constant-expr))))
+  (def-constantly-fun constantly-t t)
+  (def-constantly-fun constantly-nil nil)
+  (def-constantly-fun constantly-0 0))
 \f
 ;;;; utilities for two-VALUES predicates