[alexandria-devel] Re: Review cycle 2: SWITCH, ESCWITCH, and CSWITCH

Nikodemus Siivola nikodemus at random-state.net
Sat Jun 7 11:30:37 UTC 2008


On Sat, Jun 7, 2008 at 2:12 PM, Nikodemus Siivola
<nikodemus at random-state.net> wrote:
> macro switch ((object &key test key) &body clauses)
> macro eswitch ((object &key test key) &body clauses)
> macro cswitch ((object &key test key) &body clauses)

Documentation is insufficient: I don't see how someone can *know* how
to use these from just reading the docstrings. That is easy to fix,
however.

Implementation is nice enough. one could nitpick about the lack of
specific condition classes, but that's not a real issue, IMO.

Tests are there, but don't test all the combinations of features.

There is now way to fall through to the next clause from the bottom of
a previous one, but I don't miss that myself.

Finally, there is a question of style/consistency: unless I am
mistaken, CLHS has no examples of macros with :TEST and :KEY
arguments. Should the syntax be :TEST #'FOO, or :TEST FOO?

Right now I'm thinking :TEST #'FOO is better, because that allows you
to refer to functions stored in local variables, etc. It also matches
with DEFINE-CONSTANT does. It *is* an incompatible change, but that's
why this is still ALEXANDRIA.0.DEV.

So, if we can fix the docs, add a few more tests, and change the
:TEST/KEY syntax, I'm happy with these.

Cheers,

 -- Nikodemus



More information about the alexandria-devel mailing list