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

Why <empty-list> and <pair>? ...



> From: john@linus.mitre.org
> Posted-Date: Tue, 01 Dec 92 12:55:56 EST
> 
> Jonathan Bachrach (Jonathan.Bachrach%ircam.FR@princeton.edu) writes:
> 
>   All this talk of the lack of a need for <true> and <false> classes
>   has made me wonder why it is necessary to have an <empty-list>
>   class.  Why can't people just use `(singleton '())'?
>
> [...]
> 
> Which is not to say that <EMPTY-LIST>, and to a lesser degree <PAIR>,
> don't have their problems. [...]

Yes, why not finally take the bull by the horns and eliminate both
<empty-list> and <pair>, leaving just <list> to fend for itself as an
instantiable sequence class? Pairs could be retained disjointly as a
special-case tuple type if felt sufficiently useful, as could improper
list notation (if _really_ necessary) but with (a . b) always being
interpreted as a list with an improper tail rather than as a pair.

If it's decided to use the class heterarchy to discriminate empty from
non-empty, then I'd much rather <non-empty-list> be used in place of
<pair> and, again, have a <pair> class defined disjointly. Defining
methods for things like mapping and shallow-copying functions on
<pair> is awful.

This list/pair hang-up is a bit of Lisp tradition I could quite
happily learn to live without.

-- Keith --