[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

:KEY, hairsplit



I have an implementation here which interprets the :KEY keyword
of SUBLIS as applying to the ALIST.  Consistency seems to demand
that it applies to the TREE.  For example, the code for SUBST on
page 274, and the description of :KEY on 246.  Nevertheless, with
the description on 246 I couldn't say that they are wrong in applying
it to ALIST:

"If an operation tests elements of a sequence in any manner, the keyword
argument :key, if not nil, should be a function of one argument that will
extract from an element the part to be tested in place of the whole element."

But in SUBLIS, both ALIST and TREE are being "tested".  But since it is TREE
that would be affected, and since things like SUBST, SUBSTITUTE and relatives,
all use :key on the effected sequence, it would be inconsistent for :key to
work on ALIST as above.  Strictly speaking, I could see how an implementor
could interpret pg 246 to mean applying :key to both ALIST and TREE.
Especially because the only description of :key is in the Sequence chapter,
and despite the fact that :key is used in a number of places in the LISTS
chapter, it is not defined, leaving one with the sequence definition  Page 273
says "The naming conventions for these functions and for their keyword
arguments generally follow the conventions for the generic sequence
functions."

Fine.

I am sure most will agree to my interpretation -- That ALIST does not get :key
applied to it, and TREE does.  I am trying to convert some of one
manufacturer's tests to the standard format, and ran into this goody.  

Any official word?

RB