Re: A better way to do this?
- Posted by Al Getz <Xaxo at aol.com> Feb 25, 2005
- 443 views
Brent W. Hughes wrote: > Here are a couple of solutions that I don't like: > --**************************************** > function Sub2(sequence MyList) > MyList[900] = 5 > return MyList > end function > ----------------------------------------- > sequence List > List = repeat(0,10000) > List = Sub2(List) > ------------------------------------------ Hi there, I've used this technique myself many times, but mainly with small sequences. You could ask Rob how he implements function calls that declare privates that are also returned, but i think in order for the function to be truely recursive it has to create a new sequence (if the function calls itself). This is one of the reasons i was pushing for "re-includes"... that is, you can include a file several times in the same ew file and each time it creates a separate 'instance' of that include file. Like: include MyList.ew as ML1 include MyList.ew as ML2 now you have two lists: ML1:MyList and ML2:MyList so depending on which list you want to read/write to, you just use that one's name space qualifier, ML1 or ML2 in this case. Without that feature, you could copy the file MyList.ew and past it and rename it to MyList1.ew and the copy as MyList2.ew and include them both like: include MyList1.ew as ML1 include MyList2.ew as ML2 You then end up with the same functionality. Take care, Al And, good luck with your Euphoria programming! My bumper sticker: "I brake for LED's"