January 16, 2002 Re: comments on m..n array index syntax. make it m through n inclusive | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mac Reiter |
Mac Reiter a écrit :
> b = a[0 .. a.length);
sorry but in french keyboard, ']' and ')' are the same keyboard key, just the first is AltGr'ed..dangerous isn't it ?
Me, i still think that even if inclusive-exclusive form is more usable than it
seems, it is hard to sell.
I like the mathematical [a..b[ form, but i understand the parser don't.
For new comers this topic had been discussed in "arrays slicing range" thread.
Roland
|
January 16, 2002 Re: comments on m..n array index syntax. make it m through n inclusive | ||||
---|---|---|---|---|
| ||||
Posted in reply to Roland | "Roland" <rv@ronetech.com> wrote in message news:3C45A4FC.128C2C8F@ronetech.com... > I like the mathematical [a..b[ form, but i understand the parser don't. I always thought (a..b] and [a..b) are mathematical forms, aren't they? |
January 17, 2002 Re: comments on m..n array index syntax. make it m through n inclusive | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev |
Pavel Minayev a écrit :
> "Roland" <rv@ronetech.com> wrote in message news:3C45A4FC.128C2C8F@ronetech.com...
>
> > I like the mathematical [a..b[ form, but i understand the parser don't.
>
> I always thought (a..b] and [a..b) are mathematical forms, aren't they?
Not as i was teached math.
In fact i would'nt care notation style if ')' and ']' were not so close in my
keyboard (same key).
Roland
|
February 15, 2002 Re: comments on m..n array index syntax. make it m through n inclusive | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mac Reiter | Mac Reiter wrote: [snip] > I would also agree that some form of exclusive bound would be acceptable, though hard to parse: > > b = a[0 .. a.length-1]; > replaced by: > b = a[0 .. a.length); that is rather unpleasant (and likely to produce typos), however that is commonly what programmers what, whould may solution be better ... b = a[0 .. a.last] where a.last == a.length-1 > If the currently described exclusive ending bound remains in D, I would simply have to remove the slicing syntax from my set of tools, because I would always get it wrong -- I've switched from Basic to C/C++ enough times to know that much. I can imagine that could give errors, and D (IMHO) would be better without such gotchas. > Mac Reiter > |
February 15, 2002 Re: comments on m..n array index syntax. make it m through n inclusive | ||||
---|---|---|---|---|
| ||||
Posted in reply to DrWhat? | "DrWhat?" <DrWhat@nospam.madscientist.co.uk> wrote in message news:a4hnfh$109f$1@digitaldaemon.com... > that is rather unpleasant (and likely to produce typos), however that > is commonly what programmers what, whould may solution be > better ... > > b = a[0 .. a.last] > > where a.last == a.length-1 Practice shows that the form [0 .. a.length] (end-exclusive) is more practically convenient than end-inclusive one. Otherwise, this is a matter of taste. > I can imagine that could give errors, and D (IMHO) would be better > without such gotchas. Too late too late =) |
Copyright © 1999-2021 by the D Language Foundation