[alexandria-devel] ensure-functionf

Tobias C. Rittweiler tcr at freebits.de
Sun Nov 16 17:21:02 UTC 2008


"Attila Lendvai" <attila.lendvai at gmail.com> writes:

> dear list,
>
> i've got this patch pending:
>
> (defmacro ensure-functionf (&rest places)
>   "Call ENSURE-FUNCTION for each place in PLACES and store back the results."
>   `(progn
>      ,@(mapcar (lambda (place)
>                  `(setf ,place (ensure-function ,place)))
>                places)))
>
> it might be controversial, so i'll first send it here. if noone
> complains for a week or two, then i'll push it eventually.

It's leaky.

Better consider adopting CALLF &c

  http://common-lisp.net/pipermail/alexandria-devel/2007-September/000259.html

You'd then write ENSURE-FUNCTIONF as

  (defmacro ensure-functionf (&rest places)
    (loop for place in places collect `(CALLF #'ENSURE-FUNCTION ,place)))

  -T.

PS: Available in my alexandria branch.





More information about the alexandria-devel mailing list