Re: safety John David Stone 13 Jan 1999 18:35 UTC

Doug Currie writes:

 > I agree that a circular-list should not be considered a `list' for the
 > purpose of the specification of safety preconditions. But, if it is
 > considered a `pair' then I don't think the precondition for LAST-PAIR is
 > sufficient.

        Yikes -- you're right.  How about this?

---------------------------------------------------------------------------

LAST-PAIR

        The argument is a list or an improper list.

---------------------------------------------------------------------------

Whether this is an improvement seems to depend on how you read the
definition of an improper list in R5RS:

# A chain of pairs not ending in the empty list is called an improper
# list.

Can a chain contain a cycle?  Maybe what we want to say is that the
argument to LAST-PAIR must be a non-cyclic chain of pairs.

--
======  John David Stone - Lecturer in Computer Science and Philosophy  =====
==============  Manager of the Mathematics Local-Area Network  ==============
==============  Grinnell College - Grinnell, Iowa 50112 - USA  ==============
==========  xxxxxx@math.grin.edu - http://www.math.grin.edu/~stone/  =========