On Mon, Apr 28, 2008 at 7:21 AM, Paul Khuong <pvk@...> wrote:
> On 27-Apr-08, at 4:50 PM, Brian Mastenbrook wrote:
> > Heh. From the ANSI tests:
> > ;;; Test that :key satisfies the description in 17.2.1
> > ;;; This contradicts other parts of the spec, particularly
> > ;;; PUSHNEW, so the test is commented out.
> > ;;; (deftest adjoin.23
> > ;;; (adjoin 1 '(1 2 3) :key '1+)
> > ;;; (1 1 2 3))
> > And indeed, from the CLHS entry for "pushnew":
> > ``If :key is supplied, it is used to extract the part to be tested
> > from both item and the list element, as for adjoin.''
> > Anyway, 17.2.1 is awfully clear, but ADJOIN historically did apply the
> > KEY to the item.
> Given that there is a long-standing de facto standard, and a self-
> contradicting de jure one, I believe it would make sense to follow the
> former. Obviously, a note somewhere, at the very least in the manual,
> and maybe when a :KEY argument is supplied to ADJOIN would be needed.
> However, such a note would probably be called for even if the previous
> behaviour were preserved.
The current SBCL behaviour is at any rate broken, since it does
different things depending on INLINE declaration and interpreted vs
compiled code. This is my fault, due to a buggy compiler macro.
Reverting it in a moment.