Re: Suggestions for improvement in Euphoria
- Posted by Irv Mullins <irv at ELLIJAY.COM> Nov 24, 1998
- 454 views
On Tue, 24 Nov 1998 07:24:06 -0500, Gambit <gambit at BENDNET.COM> wrote: >Here are a few suggestions for better methods of accessing sequences in >Euphoria. It's too easy to write your own reverse, however, the rest of these are pretty good points. > Second, I think there needs to be a better way of accessing the last > element within a sequence. Perhaps a value of -1 could be used to > represent the last element, or a character such as '~' to represent the > length of the sequence. Example: > new = old[1..length(old)] > could be the same as: > new = old[1..-1] > -or- > pointer = -1 > new = old[1..pointer] > -or- > new = old[1..~] I sort of like the ~ it's quick to type and not used elsewhere. The other suggestions simply add obfuscation: pointer is misleading and -1 is counter-intuitive. > 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. Hmm. That's an interesting concept. It would certainly simplify certain types of code. > Fourth, there needs to be support for grabbing many high-level elements > at once: Also interesting, and useful. >These are some of the things I most want changed in Euphoria. I'm curious to >see who else agrees, or if RDS is already implementing features similar to these >in the upcoming Euphoria 2.1.