Re: [Scheme-reports] Immutable list SRFI updated Kevin Wortman (08 Sep 2014 23:59 UTC)
Re: [Scheme-reports] Immutable list SRFI updated John Cowan (09 Sep 2014 01:30 UTC)

Re: [Scheme-reports] Immutable list SRFI updated John Cowan 09 Sep 2014 01:26 UTC

Kevin Wortman scripsit:

> 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? .

My idea about that is that standard lists aren't consistently mutable
either: they are mutable iff they have at least one element, and
immutable otherwise.  This is very unlike the mutable sequence types of
most languages, which are equally mutable at any size.  Consequently, it
would really be better if () was an ilist but not a list; unfortunately,
*that* ship sailed more than half a century ago.

In short, lists are not a true type but an epiphenomenon based on ()
and pairs.  Consequently, ilists are not a true type either, but another
epiphenomenon based on () and ipairs.

--
John Cowan          http://www.ccil.org/~cowan        cowan@ccil.org
If I have not seen as far as others, it is because giants were standing
on my shoulders.  --Hal Abelson

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports