Index » D » possible doc bug? (page 2)

December 19, 2003
Sean L. Palmer wrote:
> We had a huge debate about this a very long time ago and Walter won.  ;)
> 
> If anything, I like your suggestion about basing arrays on one less than the
> current spec.  You're suggesting both making slice syntax inclusive on both
> ends (which already lost) and to also make arrays 1-based, which is very
> unlikely to change since most of us (everybody with a C, C++, Pascal, Java,
> or C#, or assembly background) like 0-based arrays.  It's all in what you
> were exposed to first as to what seems intuitive.  It's not so terribly
> difficult to rewire that part of your brain.  You just have to try it for a
> while, and after a while you "just get it".  ;)
> 
> Sean

that walter he always wins aye ? ;)

actually i want to clarify that i definetly would *hate* to see arrays 1 based

note the following quote: "I have no problems with arrays being 0 indexed" this should have said "i have no problems with arrays being 0 based" would have been better way to state it...

In vb the collections are almost all 1 based [1 to count] and the arrays are 0 based [0 to count - 1] by default (what i always used) but you could cause all arrays to be 1 based with a compiler flag... in fact they are the same as COM safearray's.

But all that aside, i would lobby hard against 1 based arrays, but the slice operator should follow the same philosophy of 0 based arrays in my opinion, But again that is easier to get used to [startindex .. endindex + 1] than a 1 based array would be *shudders*
December 19, 2003
Thanks for your advice. It is nice, as any Christmas present should be... ;)
I expressed only one (very doubtful: "maybe" even for me...)
I'll by another brain...
Nevermind, me too used to index by zero, till starting to work seriously under
Matlab (engineering). Here index is one-based...

To short the debate, it was the most strightforward way to link the slicing with the definition. But I don't want to be devil's advocate...

Anyway (i start my hollyday) I wold like to wish you (and to all other people on
the forum) Merry Christmas! and Happy New Year! A 2004-index based "Long live
the humankind!"

;)
No harm.





In article <brukho$nb5$1@digitaldaemon.com>, Sean L. Palmer says...
>
>We had a huge debate about this a very long time ago and Walter won.  ;)
>
>If anything, I like your suggestion about basing arrays on one less than the current spec.  You're suggesting both making slice syntax inclusive on both ends (which already lost) and to also make arrays 1-based, which is very unlikely to change since most of us (everybody with a C, C++, Pascal, Java, or C#, or assembly background) like 0-based arrays.  It's all in what you were exposed to first as to what seems intuitive.  It's not so terribly difficult to rewire that part of your brain.  You just have to try it for a while, and after a while you "just get it".  ;)
>
>Sean
>
>"Lewis" <dethbomb@hotmail.com> wrote in message news:bruevq$f9l$1@digitaldaemon.com...
>> Felix wrote:
>>
>> > Maybe arrays should be inedexed starting with 1... I know it is not the
>C/C++
>> > way, neither one of mathematics (almost every array begins with a0) but
>is more
>> > intuitive.
>>
>> I have no problems with arrays being 0 indexed, its just the slice
>operator
>> doesnt follow the same philosophy. To grab the first two elements
>>   should be a[] = b[0 .. 1] or b[lbound .. ubound] but not a[] = b[0 .. 2]
>...
>> its unintuitive to me because the start index is 0 based but the ending
>index is
>> 0 + 1 based ( or something like that), But as was stated, it seems for
>> compatibility reasons an such it wouldnt be wise to be changed. (no global
>> religion for us! :) )
>
>


December 19, 2003
Thanks for your advice. It is nice, as any Christmas present should be... ;)
I expressed only one (very doubtful: "maybe" even for me...)
I'll bUy another brain...
Nevermind, me too used to index by zero, till starting to work seriously under
Matlab (engineering). Here index is one-based...

To short the debate, it was the most strightforward way to link the slicing with the definition. But I don't want to be devil's advocate...

Anyway (i start my hollyday) I wold like to wish you (and to all other people on
the forum) Merry Christmas! and Happy New Year! A 2004-index based "Long live
the humankind!"

;)
No harm.





In article <brukho$nb5$1@digitaldaemon.com>, Sean L. Palmer says...
>
>We had a huge debate about this a very long time ago and Walter won.  ;)
>
>If anything, I like your suggestion about basing arrays on one less than the current spec.  You're suggesting both making slice syntax inclusive on both ends (which already lost) and to also make arrays 1-based, which is very unlikely to change since most of us (everybody with a C, C++, Pascal, Java, or C#, or assembly background) like 0-based arrays.  It's all in what you were exposed to first as to what seems intuitive.  It's not so terribly difficult to rewire that part of your brain.  You just have to try it for a while, and after a while you "just get it".  ;)
>
>Sean
>
>"Lewis" <dethbomb@hotmail.com> wrote in message news:bruevq$f9l$1@digitaldaemon.com...
>> Felix wrote:
>>
>> > Maybe arrays should be inedexed starting with 1... I know it is not the
>C/C++
>> > way, neither one of mathematics (almost every array begins with a0) but
>is more
>> > intuitive.
>>
>> I have no problems with arrays being 0 indexed, its just the slice
>operator
>> doesnt follow the same philosophy. To grab the first two elements
>>   should be a[] = b[0 .. 1] or b[lbound .. ubound] but not a[] = b[0 .. 2]
>...
>> its unintuitive to me because the start index is 0 based but the ending
>index is
>> 0 + 1 based ( or something like that), But as was stated, it seems for
>> compatibility reasons an such it wouldnt be wise to be changed. (no global
>> religion for us! :) )
>
>


December 19, 2003
"Felix" <Felix_member@pathlink.com> wrote in message news:bruqs5$10a8$1@digitaldaemon.com...
> Anyway (i start my hollyday) I wold like to wish you (and to all other
people on
> the forum) Merry Christmas! and Happy New Year! A 2004-index based "Long
live
> the humankind!"

Yeah, I get two weeks off, with nothing to do!  Woohoo!  Maybe I'll get the latest DMD and play around.

> ;)
> No harm.

No harm, no foul!  ;)

Sean


December 19, 2003
> Anyway (i start my hollyday) I wold like to wish you (and to all other
people on
> the forum) Merry Christmas! and Happy New Year! A 2004-index based "Long
live
> the humankind!"

You too, and to all the other D-programmers.

I think 2004 will have some big things for D. :)

Cheers everyone



-- 
Matthew Wilson

STLSoft moderator (http://www.stlsoft.org)
Contributing editor, C/C++ Users Journal
(www.synesis.com.au/articles.html#columns)

"An Englishman by birth, a Yorkshireman by the grace of God" -- Michael Gibbs

----------------------------------------------------------------------------
---



December 19, 2003
"Matthew" <matthew.hat@stlsoft.dot.org> wrote in message
news:brvs3h$2jsp$1@digitaldaemon.com...
| > Anyway (i start my hollyday) I wold like to wish you (and to all other
| people on
| > the forum) Merry Christmas! and Happy New Year! A 2004-index based "Long
| live
| > the humankind!"
|
| You too, and to all the other D-programmers.
|
| I think 2004 will have some big things for D. :)
|
| Cheers everyone
|
|
|
| --
| Matthew Wilson
|
| STLSoft moderator (http://www.stlsoft.org)
| Contributing editor, C/C++ Users Journal
| (www.synesis.com.au/articles.html#columns)
|
| "An Englishman by birth, a Yorkshireman by the grace of God" -- Michael
| Gibbs
|
| --------------------------------------------------------------------------
--
| ---
|
|
|

I was planning to do it around the 23rd, 24th, but since you guys are doing it now, me too.

Happy holidays to you all, let 2004 be a very good year for all of us, and for D too ;).

-----------------------
Carlos Santander Bernal


Next ›   Last »
1 2
Top | Discussion index | About this forum | D home