Idiomatic way to process const/immutable arrays as ranges

Dicebot m.strashun at gmail.com
Mon Feb 11 09:15:45 PST 2013


On Monday, 11 February 2013 at 16:53:53 UTC, Jonathan M Davis 
wrote:
> On Monday, February 11, 2013 17:42:13 Dicebot wrote:
>> On Monday, 11 February 2013 at 16:25:35 UTC, Dmitry Olshansky
>> 
>> wrote:
>> > I might be wrong but you can slice it e.g.:
>> > 
>> > args[].join(" ");
>> 
>> [], as well as [0.$] does return the very same qualified slice,
>> have tried it.
>
> For arrays, [] returns a tail-const slice of the array. If it 
> doesn't, it's a
> bug.
>
> - Jonathan M Davis

Actually I was wrong, beg my pardon. It does return tail-const 
slice, but join fails to accept even tail-const one. Will debug 
further and report.


More information about the Digitalmars-d-learn mailing list