Re: converting sequence to string

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu