[slime-devel] Re: ABCL patches for SLIME HEAD

Nicolas Neuss neuss at math.uni-karlsruhe.de
Mon Sep 3 18:58:11 UTC 2007


"Tobias C. Rittweiler" <tcr at freebits.de> writes:

>   (mapcar #'+ '(1 2 3 4) '#1=(10 . #1#))

> I figure that at least LOOP's for-as-in-list clause could be
> meaningfully used in the above manner. So rewriting the code in question
> is no problem. Still, it's something I'd like to find out what's the
> commonly shared opinion about this.

I do not like it, because it uses a tricky construct to achieve something
simple.  I would use something like

  (mapcar (curry #'+ 10) list)

instead, where

(defun curry (func &rest args)
  "Supplies @arg{args} to @arg{func} from the left."
  #'(lambda (&rest after-args)
      (apply func (append args after-args))))

is a utility function.

Nicolas



More information about the slime-devel mailing list