1. Re: A better way to do this?
- Posted by "Kat" <gertie at visionsix.com> Mar 02, 2005
- 515 views
On 25 Feb 2005, at 15:21, Al Getz wrote: > > > posted by: Al Getz <Xaxo at aol.com> > > 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. Can't you do this with the exec() function? Just read any file into a sequence, and call it what you want, and exec() it as needed? Kat