[Prev][Next][Index][Thread]
Re: Why are head and tail completely sealed?
In article <slrn84378n.1a6.neelk@brick.cswv.com>, neelk@alum.mit.edu wrote:
> Is there some subtlety I'm not seeing?
Other than that part of the DRM having been written before sealed domains
were invented, you mean? :-)
When you see something like this defined as a function rather than as a
generic (even a closed generic) it tends to be for one of two reasons:
- it's actually implemented in terms of something else that is a generic
function.
- it's though to be to specialised and non-general to make it generic.
I suspect that the latter is the case here. Pairs and Lists are very
wierd data structures, with strange semantics. Head() and tail() are
functions that don't fit well with the other container classes. For
proper lists they give the same results (apart from stucture sharing) as
x[0] and copy-sequence(x, start:1), but for improper lists they have
results that can't be expressed and make no sense in most other collection
classses.
-- Bruce
Follow-Ups:
References: