Re: 0-based Indexing

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hello CK,

> > I have suffered several times from Euphoria's 
> > lack of 0-based indexing.
> > Adding and Subtracting 1's to make things 
> > Offset into the correct location.
> 
> Uh... the first item of a sequence is s[1]. 
> How is that at all wrong?
> 
> I understand you're probably talking about 
> poking things into memory or something else 
> other than arrays or sequence variables.
> 
> > 1-based indexing is a real pain in the neck.
> 
> Maybe for those who can't understand the 
> easy-to-understand sequence indexing, Darth. :P

The optional 0-indexing in EU may be useful 
if you want to translate your basic 
programs into EU code.

If you have many basic arrays with 0-indexing and want
to translate them into EU, yes, this is a real pain and 
a rich source of the subtle bugs, especially when 
indexes are calculated.
 
I have dropped some my translations from basic into EU 
just because of too many confusions in indexes,
especially if some of the 0-elements 
are or are not empty.

Maybe, someone has a powerful tip, 
other than just a good attention?

For the new programming, it is not important,
1 or 0, I think.

Regards,
Igor Kachan
kinz at peterlink.ru

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu