November 11, 2002 Re: Slicing (new argument, I think) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer | Sean L. Palmer wrote:
> I'm in favor of that, but I'd also like range slices to use the
> a[first..last] syntax.
>
> I hope to God they don't switch over from the "it works well for lengths"
> argument to "there's too much legacy code written in D to change it now"
> argument. ;) I think it's bad the way it is now, and needs changing.
How about a "this is a stupid thing to be thinking about for more than twenty seconds" argument? I use both Python and D and _never even noticed_ that they use different end-point inclusiveness with slicing; it was as subconscious a part of programming as the difference in logic operators. Even in comparable code it's the whole difference of a plus one or a minus one.
|
November 11, 2002 Re: Slicing (new argument, I think) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Burton Radons | Burton Radons wrote:
> How about a "this is a stupid thing to be thinking about for more than twenty seconds" argument? I use both Python and D and _never even noticed_ that they use different end-point inclusiveness with slicing; it was as subconscious a part of programming as the difference in logic operators. Even in comparable code it's the whole difference of a plus one or a minus one.
And what percentage of the bugs in software are "off by one" errors? Most heap corruption bugs are only "the whole difference of a plus one or a minus one".
If you "never even noticed" that they use different end-point inclusiveness rules, I wonder how many bugs and incorrect behaviors you also "never even noticed".
Hmmm... Should I even mention my concerns about the author of "D for Linux" not being aware of how D slicing works? Oops, too late... So how does slicing work in DLI?
Mac
|
November 12, 2002 Re: Slicing (new argument, I think) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Burton Radons | Do you have *ANY* idea just how many bugs fall in the "off by one" category? If you think for one minute that this is an issue not worth thinking about for more than twenty seconds, I for one can't respect your judgment. And if you have any influence on the design of D, I fear it will turn out a worse language for it. Oh well. Sean "Burton Radons" <loth@users.sourceforge.net> wrote in message news:aqoskm$11v9$1@digitaldaemon.com... > Sean L. Palmer wrote: > > > I'm in favor of that, but I'd also like range slices to use the a[first..last] syntax. > > > > I hope to God they don't switch over from the "it works well for lengths" > > argument to "there's too much legacy code written in D to change it now" argument. ;) I think it's bad the way it is now, and needs changing. > > > How about a "this is a stupid thing to be thinking about for more than twenty seconds" argument? I use both Python and D and _never even noticed_ that they use different end-point inclusiveness with slicing; it was as subconscious a part of programming as the difference in logic operators. Even in comparable code it's the whole difference of a plus one or a minus one. |
Copyright © 1999-2021 by the D Language Foundation