Re: converting sequence to string
- Posted by Bernie Ryan <xotron at BUFFNET.NET> Mar 26, 2000
- 557 views
On Sun, 26 Mar 2000 17:58:43 -0500, Irv Mullins <irv at ELLIJAY.COM> wrote: >You can do recursion without routine_id, because the function is declared before >the line that calls it. Irv: This is the example I was replying to: -- global function deNest(sequence nestedSequence) --deNests a sequence by recursing through it and 'flattening' it to 1 level sequence outputSequence outputSequence = {} for a=1 to length(nestedSequence) do if not sequence(nestedSequence[a]) then outputSequence = outputSequence&nestedSequence[a] else outputSequence = outputSequence & deNest(nestedSequence[a]) -- <<<<<<<<<<<<<<<<< --- look here end if end for return outputSequence end function If I run this in Euphoria how will Euphoria know what deNest function looks like the first time in the first pass of the interpeter without seeing the whole function first thats why I thought that a routine_id function, a call_func function and routine_id variable is necessary. This needs a forward reference to resolve this code so a Euphoria does not error out on the first pass. Maybe I'am wrong so straight my thinking out ? Maybe you have a different trick to do this ? Bernie