Wait, what? What is AliasSeq?

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 9 12:39:17 PDT 2015


On Thu, Jul 09, 2015 at 07:10:38PM +0000, Jonathan M Davis via Digitalmars-d wrote:
> On Thursday, 9 July 2015 at 18:45:56 UTC, Marc Schütz wrote:
> >Interestingly, it goes on by saying:
> >
> >>An n-tuple is defined inductively using the construction
> >>of an ordered pair.
> >
> >Although not stated explicitly, this implies (a kind of) auto
> >expanding!  => Fits more than perfectly :-P
> 
> No one who has ever seriously used tuples in any programming language
> I've ever heard of would expect tuples to auto expand. Auto expansion
> makes them _considerably_ less useful.

FWIW, Perl arrays auto-expand (or more precisely, auto-denest), unless
you force them not to by taking a reference to the subarray instead. I'm
not sure if this behaviour has changed in the newest version of Perl,
but it was the cause of much confusion to new learners.

Not the same thing as tuples, I know, but somebody *did* propose the
name "array" for D's auto-expanding whatchamacallit.


T

-- 
Curiosity kills the cat. Moral: don't be the cat.


More information about the Digitalmars-d mailing list