Hi, I had the need to make a recursive function. I got a few problems, and 
when I wrote this simple example on the OM shell I got errors:

------------
function Factorial
        input Integer n;
        output Integer fac;
        algorithm
                if n == 0 then
                        fac := 1;
                else
                        fac := n*Factorial(n-1);
                end if;
end Factorial;
------------
#-- Cannot convert empty prefix to component reference
Error occured building AST
Syntax Error
Class Factorial (its type)  not found in scope Factorial.
No matching function found for Factorial
Class Factorial not found in scope Factorial.
No matching function found for Factorial
Class Factorial not found in scope Factorial.
------------

Is this a problem with OpenModelica, or is it the Modelica language itself 
that does not allow recursive functions? Are there workarounds?

Cheers,
-Federico

Attachment: pgpODfB3KwHzZ.pgp
Description: PGP signature

Reply via email to