Re: Last Element Reference

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

Robert Craig wrote:
> On the other hand, $ will sometimes speed up the code
> and reduce the size of translated code. e.g.
>   x[i][1..length(x[i])-1]
> vs.
>   x[i][1..$-1]

Of course, I should have added that using a
"negative subscript" (-2) would also speed up this code.

It's just that the $ solution will not hurt the speed of
normal (positive) subscripts, the way that it appears
the negative subscript solution would. Nor will it
require additional subscripting code to be emitted by
the Translator. I'm sure that the vast majority of subscripts will
continue to be the normal (positive) ones that we allow today.

Regards,
    Rob Craig
    Rapid Deployment Software
    http://www.RapidEuphoria.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu