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

Re: [Scheme-reports] Immutable list SRFI updated

Sure. I guess my point is that a new data type can have either "proper disjoint type" or "works like lists" semantics, but not both at the same time. The SRFI document seems to be trying to have it both ways.

I have had problems stemming from empty lists being indistinguishable from empty alists, so I advocate making new types properly disjoint. But since the spirit of this proposal is to be close to a drop-in alternative to SRFI 1, "works like lists" semantics might be appropriate in this case.

Best regards,
Kevin Wortman

On Tue, Sep 9, 2014 at 3:00 AM, Taylan Ulrich Bayirli/Kammer <taylanbayirli@x> wrote:
Kevin Wortman <kwortman@x> writes:

> I am not entirely sold on using '() to represent an empty immutable
> list. It feels like a shortcut, and that instead there should be
> another constructor that yields a empty ilist object that is distinct
> from all other objects. As it is, I'm not sure we can rightly say that
> ilist is a disjoint data type, since there exists an object that
> satisfies both ilist? and list? .

Lists are not a disjoint type anyway, since all but () satisfy pair?,
and () satisfies null?.


Scheme-reports mailing list