Re: Last Element Notation

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

I like either "fin" or "end", as they're both easy to type & are descriptive
rather than symbolic, which can help newbies understand what's meant.

Dan Moyer



----- Original Message -----
From: "Juergen Luethje" <j.lue at gmx.de>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Last Element Notation


>
>
> David wrote:
>
> > Robert Craig wrote:
> >
> >> Unless someone has a better idea, I think I'll go ahead
> >> with this idea of $ meaning "the index of the last element".
> >> e.g.
> >>     s[1..$]
> >>     s[1..$-1]
> >>     s[$-2]
> >> etc.
> >
> > I agree that this is probably the best notation. There are shorter
notations
> > (for example, see Python), but they lack the clarity of the '$'
notation.
> >
> > The only real complaint is that it's another step toward the
Perlification of
> > the language. The 'end' token would be more clear:
> >
> >      s[1..end]
> >      s[1..end-1]
> >      s[end-2]
> >
> > but I have difficulty convincing myself that this is much better,
especially
> > given that 'end' already has a distinct meaning in Euphoria. And the '$'
is
> > shorter and easy to see.
>
> How about using this, in order to prevent Perlification:
>      s[1..fin]
>      s[1..fin-1]
>      s[fin-2]
>
> AFAIR 'fin' often appeared at the end of old movies.
>
> > Besides, If it were *true* Perlification, you'd have selected the '^'
token.
> >
> > -- David Cuny
>
> Regards,
>    Juergen
>
> --
>  /"\  ASCII ribbon campain  |    |\      _,,,---,,_
>  \ /  against HTML in       |    /,`.-'`'    -.  ;-;;,_
>   X   e-mail and news,      |   |,4-  ) )-,_..;\ (  `'-'
>  / \  and unneeded MIME     |  '---''(_/--'  `-'\_)
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu