Wait, what? What is AliasSeq?

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 14 07:06:09 PDT 2015


On 7/13/15 8:10 PM, Mike wrote:
> On Monday, 13 July 2015 at 23:01:35 UTC, Dmitry Olshansky wrote:
>
>> List in CS at large is generally speaking not indexable nor defines
>> such operations. So there may be a lot of people who don't care for
>> what a list is, but that doesn't make list a synonym for sequence.
>
> "Sequence" implies that Item(n+1) is in some way dependent on Item(n),
> so "Sequence" is a misnomer in this situation, and "Seq" is a misnomer
> for the misnomer.

STL's "sequential containers" do not have serial dependence on items. 
There, "sequential" is meant as a converse of "associative".

> Furthermore, given that in a linked-list, one must
> first obtain Item(n) to get to Item(n+1), "linked-list" is ironically a
> misnomer for what is truly a sequence.  Hence the reason for the need to
> persistently qualify it with the "linked-" prefix.
>
> Even in the CS domain, the term "list" is rather general, as evident in
> its liberal usage in other programming languages and literature, and the
> need to persistently add qualifiers/quantifiers (e.g. "linked-") to
> disambiguate it.
> "List" is agnostic to order, indexing, linking, or any other specific
> qualification/quantification.  It is simply an enumeration of items
> (e.g. "grocery list", "todo list", "laundry list").  "List" describes,
> quite well, the subject under scrutiny, evident by the fact that
> "AliasList" was one of the first terms to come to mind.

I kinda agree in abstract especially because languages like Java and 
Perl use "lists" for arrays (see e.g. Java's ArrayList). Yet lists are 
often implicitly considered linked lists, ever since LISP. Also as I 
mentioned, each language bends terminology a bit one way or another. I 
don't think "list" is appropriate for describing a D abstraction that is 
indexable and sliceable. "Sequence" is better, and "Slice" or "Array" 
would be actually most recommended.


Andrei



More information about the Digitalmars-d mailing list