[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why <empty-list> and <pair>? or More heresy...
- To: email@example.com, Jonathan Bachrach <Jonathan.Bachrach@ircam.fr>
- Subject: Re: Why <empty-list> and <pair>? or More heresy...
- From: firstname.lastname@example.org (Andrew LM Shalit)
- Date: Tue, 1 Dec 1992 11:27:50 -0500
At 1:36 PM 12/1/92 +0100, Jonathan Bachrach wrote:
> 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 '())'? Given that, why even have a
> <pair> class? Programs can distinguish between a <pair> instance and
> an <empty-list> instance using the same `(singleton '()). This change
> would definitely simplify the class structure. Granted, in some cases
> programmers might need to employ two methods to flag list arguments
> that must be non-empty, such as for `(setter car)', but in most cases
> they need to handle '() specially anyway and would be writing a
> separate method for it.
I think it would be perfectly reasonable to do away with <empty-list>,
and use (singleton '()) instead. Note that () would be an instance
of <list> but not of <pair>.