Re: Proposal : mnemonic for start index for slices

2015-08-09 Thread sigod via Digitalmars-d
On Saturday, 8 August 2015 at 13:42:03 UTC, John Colvin wrote: That would be neat, but the thing is you can already do this: auto sub = arr[idx + 123 * 10 .. $][0 .. 1]; The only argument that might hold weight is that calculating opDollar and doing two index/slice operations might be relativ

Re: Proposal : mnemonic for start index for slices

2015-08-09 Thread Walter Bright via Digitalmars-d
On 8/8/2015 6:08 AM, Temtaime wrote: Any ideas ? Should i try to create a DIP ? It's a good suggestion, but the responses here pretty much cover the territory adequately with existing features. I don't think a new feature for this is justified. But we're always looking for better ideas, so do

Re: Proposal : mnemonic for start index for slices

2015-08-08 Thread ChangLong via Digitalmars-d
On Saturday, 8 August 2015 at 13:08:08 UTC, Temtaime wrote: Hi ! I want to add some sugar to D : sometimes it's necessary to use complex start index. For example: auto sub = arr[idx + 123 * 10..idx + 123 * 10 + 1]; Proposal is to add a mnemonic for start index, for instance : auto sub = arr[

Re: Proposal : mnemonic for start index for slices

2015-08-08 Thread Shammah Chancellor via Digitalmars-d
On Saturday, 8 August 2015 at 13:08:08 UTC, Temtaime wrote: Hi ! I want to add some sugar to D : sometimes it's necessary to use complex start index. For example: auto sub = arr[idx + 123 * 10..idx + 123 * 10 + 1]; Proposal is to add a mnemonic for start index, for instance : auto sub = arr[

Re: Proposal : mnemonic for start index for slices

2015-08-08 Thread John Colvin via Digitalmars-d
On Saturday, 8 August 2015 at 13:08:08 UTC, Temtaime wrote: Hi ! I want to add some sugar to D : sometimes it's necessary to use complex start index. For example: auto sub = arr[idx + 123 * 10..idx + 123 * 10 + 1]; Proposal is to add a mnemonic for start index, for instance : auto sub = arr[

Re: Proposal : mnemonic for start index for slices

2015-08-08 Thread Idan Arye via Digitalmars-d
On Saturday, 8 August 2015 at 13:08:08 UTC, Temtaime wrote: Hi ! I want to add some sugar to D : sometimes it's necessary to use complex start index. For example: auto sub = arr[idx + 123 * 10..idx + 123 * 10 + 1]; Proposal is to add a mnemonic for start index, for instance : auto sub = arr[

Re: Proposal : mnemonic for start index for slices

2015-08-08 Thread Rikki Cattermole via Digitalmars-d
On 9/08/2015 1:08 a.m., Temtaime wrote: Hi ! I want to add some sugar to D : sometimes it's necessary to use complex start index. For example: auto sub = arr[idx + 123 * 10..idx + 123 * 10 + 1]; Proposal is to add a mnemonic for start index, for instance : auto sub = arr[idx + 123 * 10..# + 1]

Proposal : mnemonic for start index for slices

2015-08-08 Thread Temtaime via Digitalmars-d
Hi ! I want to add some sugar to D : sometimes it's necessary to use complex start index. For example: auto sub = arr[idx + 123 * 10..idx + 123 * 10 + 1]; Proposal is to add a mnemonic for start index, for instance : auto sub = arr[idx + 123 * 10..# + 1]; // # == start index # is for example