0.74: recursive function calls not supported yet

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

0.74: recursive function calls not supported yet

kircher
Hello,

I encountered this unexpected behaviour:

>Octave, version 0.74.  Copyright (C) 1992, 1993, John W. Eaton.
>This is free software with ABSOLUTELY NO WARRANTY.
>For details, type `warranty'.

>octave:1> hadamard(3)
>error: recursive function calls not supported yet

Recursion definitely worked in previous releases. I tried both, a
decstation 3100 (ultrix) and a NeXT (NS 3.0). Can anybody
confirm/disconfirm this?

Gerhard Kircher


Reply | Threaded
Open this post in threaded view
|

Re: 0.74: recursive function calls not supported yet

John Eaton-3
On Wed, 21 Jul 93 15:46:34 +0100, [hidden email] wrote:

: I encountered this unexpected behaviour:
:
: >Octave, version 0.74.  Copyright (C) 1992, 1993, John W. Eaton.
: >This is free software with ABSOLUTELY NO WARRANTY.
: >For details, type `warranty'.
:
: >octave:1> hadamard(3)
: >error: recursive function calls not supported yet
:
: Recursion definitely worked in previous releases. I tried both, a
: decstation 3100 (ultrix) and a NeXT (NS 3.0). Can anybody
: confirm/disconfirm this?

Actually, if it worked, you were just getting lucky.  For example, one
of these would work, but the other would fail:

  function y = fact (n)
    if (n > 1) y = fact (n - 1) * n; else y = 1; endif
  end

  function y = fact (n)
    if (n > 1) y = n * fact (n - 1); else y = 1; endif
  end

To fix this, some work needs to be done in the symbol table code and
the code that implements function calls to properly create a new
context for recursive calls.

jwe