s-expressionists / wscl

Sources of the "Well Specified Common Lisp" specification which is based on the final draft of the Common Lisp standard but is not a new Common Lisp standard.
https://s-expressionists.github.io/wscl/
Other
38 stars 4 forks source link

Explicitness of key is not consistent #15

Open moon-chilled opened 2 years ago

moon-chilled commented 2 years ago

Different portions of the hyperspec are inconsistent with each other in how explicit they are in their treatment of key arguments to list and sequence functions. For instance, sort explicitly mentions the use of key, saying:

The first argument to the predicate function is the part of one element of sequence extracted by the key function (if supplied); the second argument is the part of another element of sequence extracted by the key function (if supplied)

But member-if does not explicitly acknowledge key at all, saying only:

The argument to the predicate function is an element of list.

Some degree of explicitness should be decided upon, and then applied uniformly to the specification of all functions accepting keys.

moon-chilled commented 2 years ago

I suggest that it would be better to be more explicit rather than less. 17.2 gives a broad overview of the nature of test and key functions, but it does not account for member-if. Being more explicit and verbose also means that it is easier to use the spec as a reference ('what all does this function do again?').