Hi all,
this model yields an infinite loop on instantiation with my copy of omc.
Does it have to? Dymola obviously does not allow such a faculty
function, but it seems to be legal modelica.
model Foo
function fac
input Integer n;
output Integer f = if n <= 0 then 0 else f1;
protected
Integer f1 = fac(n-1) * n;
end fac;
Integer f;
equation
f = fac(ceil(time));
end Foo;
--
Christoph Höger
Technische Universität Berlin
Fakultät IV - Elektrotechnik und Informatik
Übersetzerbau und Programmiersprachen
Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin
Tel.: +49 (30) 314-24890
E-Mail: [email protected]