1. Re: subscripts (Long Post)
- Posted by Lewis Townsend <keroltarr at HOTMAIL.COM> May 16, 2000
- 420 views
Hello Rob, >Your idea could also be quite useful, >but I want to keep things simple. Actually I was thinking it would make things MORE simple. a = sequence_of_unknown_length_or_structure sb = sequence_to_subscript_one_value_from_a if length (sb) = 1 then return a [sb[1]] elsif length (sb) = 2 then return a [sb[1]][sb[2]] elsif length (sb) = 3 then return a [sb[1]][sb[2]][sb[3]] elsif length (sb) = 4 then return a [sb[1]][sb[2]][sb[3]][sb[4]] elsif length (sb) = 5 then return a[sb[1]][sb[2]][sb[3]][sb[4]][sb[5]] elsif length (sb) = 6 then return a[sb[1]][sb[2]][sb[3]][sb[4]][sb[5]][sb[6]] elsif length (sb) = 7 then return a[sb[1]][sb[2]][sb[3]][sb[4]][sb[5]][sb[6]][sb[7]] end if -- Notice how it gets bigger all the time. -- would become: a = sequence_of_unknown_length_or_structure sb = sequence_to_subscript_one_value_from_a return a [sb] -- note that this would work for 8+ levels with no more code This seems simpler to me, or were you talking about simplicity of implementation rather than simplicity of use? Even so, I thought you said it would be easy to implement as well. On Tue, 9 May 2000 20:06:23 -0400, you wrote: >They are both fairly easy to implement, and won't >break existing code... Okay, I've demonstrated how it is simpler and You've admitted that it could be useful and easy to implement. I don't mean to be unduly insistent about it but I just want to know what your remaining objection is. later, Lewis Townsend ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com