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

Issue: LAST-N (Version 1)



    Date: Fri, 4 Dec 87 16:49 EST
    From: Kent M Pitman <KMP@STONY-BROOK.SCRC.Symbolics.COM>

    Issue:        LAST-N
    References:   LAST (p267)
    Category:     ENHANCEMENT
    Edit history: 04-Dec-87, Version 1 by Pitman
    Proposal (LAST-N:ALLOW-OPTIONAL-ARGUMENT):

      Allow LAST to take an optional argument N, saying how many cells to return.

You should say explicitly that the default for N is 1.

The following two paragraphs cannot be correct.  For example, think about
(last '(a)), which you are saying returns nil.

      If N is equal to the number of cons cells in the list L, then the atom which
      terminates the list L is returned.

      If N is greater than the number of cons cells in the list L, then it is an
      error if the list is not a proper list. If in this case the list is a proper
      list, then L is returned.

I think what you really mean is

      If N is zero, then the atom that terminates the list L is returned.
      If N is greater than or equal to the number of cons cells in 
      the list L, then the result is L.

This correction makes it consistent with your examples.

With these corrections, I don't oppose the proposal.  I'm not strongly in
favor of it, since I put less priority on enhancements than on correcting
mistakes in what we've got already.  I'll favor it if others do.