[alexandria-devel] Review cycle 3: WHICHEVER, XOR

Gustavo gugamilare at gmail.com
Tue Apr 6 17:12:14 UTC 2010


Sorry, forgot to CC alexandria-devel


2010/4/5 Pascal J. Bourguignon <pjb at informatimago.com>

>
> On 2010/04/05, at 18:55 , Nikodemus Siivola wrote:
> > macro WHICHEVER &rest possibilities
> >
> >  "Evaluates exactly one of POSSIBILITIES, chosen at random."
>
> ONE-OF seems to be often used not name a similar function.
>
> I understand the need for a macro version of the feature, but could we
> name it in a similar way?
>
> Could we include the ONE-OF function too?
>
> If we included a function named ONE-OF, perhaps we could name the
> macro EVAL-ONE-OF ?
> (think EVAL-WHEN, not EVAL).
>
>
As a functional version of *whichever *there is already *random-elt*. I
can't think of an implementation of *one-of* that would not need to build a
list at compile time, so the only difference between *one-of* and *
random-elt* is if the construction is made explicitly by the user or
implicitly.

As for the name, I believe *whichever** *is a good name and should not be
changed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/alexandria-devel/attachments/20100406/dfb1a8a9/attachment.html>


More information about the alexandria-devel mailing list