Improvement to Common Lisp:
multiple-value-constantly evaluates each form, gathers all the values together, and yields a constant function that takes any number of arguments and returns the gathered values. It’s the spawn of multiple-value-call and constantly.
constantly could be defined as
(defun constantly (it) (multiple-value-constantly it)).
Here’s my implementation:
(defmacro multiple-value-constantly (&rest forms) `(multiple-value-call (lambda (&rest l) (lambda (&rest any) (declare (ignore any)) (values-list l))) ,@forms))
May induce funny feeling in Lisp programmers:
(setf (symbol-function 'constantly-nothing) (multiple-value-constantly)) (constantly-nothing)
Of course, you have to be careful using multiple values; they can be tricky.