Re: Suggestions for improvement in Euphoria

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

>  Third, there needs to be better support for multi-depth slicing:
>    new = old[1][5][2][3]
>  should be replaced with:
>    new = old[{1, 5, 2, 3}]
>      -or-
>    pointer = {1, 5, 2, 3}
>    new = old[pointer]
>  as this would allow you to use a sequence to let you access different
>  depths during run-time without having to use recursive function.


Great suggestion! It's brilliant! Using sequences to address sequeces...
mmm... terrific! With this enhancement you can do 100% dynamic
data strucutures. Note that you can still use the old (current) way:

s = {{1,2,3,{4,5}}}
s1 = s[{1,4,1}]    -- s1 = {4}
s2 = s[{1,4}][1]   -- s2 = {4}
s3 = s[1][4][1]    -- s3 =  {4}

No code breaking!!!

Another suggestion that comes to my mind:

s = {a,b,c,d,e}
s1 = s[~..{1,3,5}]    -- s1 = {a,c,e}

Regards,
    Daniel   Berstein
    daber at pair.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu