Slicing AliasSeq-s

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Tue Dec 22 09:33:23 PST 2015


On Tuesday, 22 December 2015 at 08:17:33 UTC, Shriramana Sharma 
wrote:
> Adam D.  Ruppe wrote:
>> Slicing a tuple creates a new tuple that refers to the same 
>> objects as the previous one. So it doesn't deep copy... but 
>> remember this is irrelevant to any D program
>
> I realize that but just wanted to know whether the word slicing 
> is used in this context in the same sense as elsewhere.

Well, from the perspective of the programmer, there's no semantic 
difference whether the compiler does a deep copy or does 
something like slice an array of aliases. Because there's no 
address to access, there's no perceivable difference between a 
shallow copy or a deep copy. So, slice is very much the right 
word to use in the documentation regardless of what the compiler 
is doing internally.

- Jonathan M Davis


More information about the Digitalmars-d mailing list