Re: Last Element Reference

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

Hello Derek, Hello Rob,

How about  '|' instead of '$'  ?

>   sequence X
> 
>   X = {"ant", "bear", "cat", "dog", "elephant"}
> 
>   ? X[|] --> "elephant"
>   ? X[|][|] --> 't'
>   ? X[3 .. |] --> {"cat", "dog", "elephant"}
>   ? X[3 .. |-1] --> {"cat", "dog"}
>   ? X[|-1..|] --> {"dog", "elephant"}
>   ? X[|][3..|] --> "ephant"
>   ? X[|][|-3..|] --> "hant"
>   ? X[2][|] --> 'r'
>   ? X[1 .. |-1] --> {"ant", "bear", "cat", "dog"}
>   ? X[1 .. floor(|/2)] --> {"ant", "bear"}
>   ? X[floor(|/2)+1 .. |] --> {"cat", "dog", "elephant"}

'|' is just a sign for border, bound, limit,
edge, brink and other ends.

'$' is dollar, nothing more.

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