Re: Is subscripting a slice useful

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

Another good thing would be, subscripting inline constants.
? {"asdf"}[1]
prints 'a'


On Fri, 8 Oct 2004 15:36:03 -0700, codepilot Gmail Account
<codepilot at gmail.com> wrote:
> 
> 
> On Fri, 08 Oct 2004 14:44:29 -0700, cklester <guest at rapideuphoria.com>
> wrote:
> >
> > posted by: cklester <cklester at yahoo.com>
> >
> > codepilot Gmail Account wrote:
> > >
> > > Right now subscripting a slice is not allowed.
> > > I think that this code should print out {97,97,97,97}.
> >
> > }}}
<eucode>
> > constant asdf={"asdf","asdf","asdf","asdf"}
> > ? asdf[1..2][1]
> > </eucode>
{{{

> >
> > Looks like it should print {'a','s','d','f'}
> >
> > because asdf[1..2] is { "asdf", "asdf" }
> since asdf[1..2] is { "asdf", "asdf" } and asdf[1..2][1] is currently
> illegal, it could get the 1st subscript from every sequence in the
> slice, while asdf[1..2][2] gets the second. So that
> asdf[1..2][subscript] is the same as
>
> {asdf[1..2][1][subscript],asdf[1..2][2][subscript],asdf[1..2][3][subscript],asdf[1..2][4][subscript]}
> 
> >
> > -=ck
> > "Programming in a state of EUPHORIA."
> > http://www.cklester.com/euphoria/
> >
> >
> 
> 
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu