[HARLEQUIN][Common Lisp HyperSpec (TM)] [Previous][Up][Next]


Issue BUTLAST-NEGATIVE Writeup

Issue:        BUTLAST-NEGATIVE

Forum: Editorial

References: BUTLAST (p271), NBUTLAST (p271)

Category: CLARIFICATION/CHANGE

Edit history: 01-Mar-91, Version 1 by Pitman

Status: For X3J13 consideration

Problem Description:

What happens if the second argument to BUTLAST and NBUTLAST is negative?

Proposal (BUTLAST:SHOULD-SIGNAL):

Specify that if the second argument, N, to BUTLAST or NBUTLAST is negative,

then an error `should be signalled'.

Test Cases:

1. (BUTLAST '(A B C) -2)

2. (LET ((X (LIST 'A 'B 'C)))

(NBUTLAST X -2))

Rationale:

Mostly this precludes implementations from adopting other,

variant interpretations.

Current Practice:

1. Symbolics Genera returns (A B C NIL NIL).

2. Symbolics Genera signals an error.

Cost to Implementors:

Small.

Cost to Users:

None. Portable programs cannot currently rely on any particular

behavior.

Cost of Non-Adoption:

Users would be confused about what to expect because implementations might

adopt creative interpretations (such as Genera's) which are not supported

in other implementations and so become a barrier to portability.

Benefits:

Tighter spec.

Aesthetics:

Genera's alternate interpretation of BUTLAST is arguably aesthetic, but

does not extend well to NBUTLAST. The interpretation proposed here makes

BUTLAST and NBUTLAST more consistent.

Discussion:

Pitman supports this proposal.


[Starting Points][Contents][Index][Symbols][Glossary][Issues]
Copyright 1996, The Harlequin Group Limited. All Rights Reserved.