Wait, what? What is AliasSeq?

Mike via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 14 14:13:42 PDT 2015


On Tuesday, 14 July 2015 at 14:06:04 UTC, Andrei Alexandrescu 
wrote:

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

Indeed, but the term "sequence" has existed long before the STL 
authors (mis)used it.  Actually, 3 of the 5 main "sequence 
containers" *are* sequences.  The other 2, vector (which is 
another name that has always bothered me) and array, are really 
best described as a random-access containers, but the authors 
probably didn't want to split hairs and make another category.

My interpretation of the word "list" both in and out of the CS 
domain jives with random access.  Consider a stream.  I define it 
to be truly a "sequence" of bytes, specifically because of its 
serial nature.  I would definitely *not* define it as a "list" of 
bytes.

When we say "these items must be accessed in sequence", we imply 
that Item(n+1) should be accessed only after Item(n) is accessed.

In our nomenclature, we should probably look more to the origin 
of terms, and their usage in other domains, than their (mis)use 
in the CS domain, especially C++.

Mike



More information about the Digitalmars-d mailing list