[Prev][Next][Index][Thread]
Dynamic typing confuses me!
-
To: info-dylan@ai.mit.edu
-
Subject: Dynamic typing confuses me!
-
From: "Bertrand Augereau" <baugereau@ifrance.kom>
-
Date: Fri, 7 Sep 2001 19:15:01 -0400 (EDT)
-
Organization: Wanadoo, l'internet avec France Telecom
-
Xref: traf.lcs.mit.edu comp.lang.dylan:13637
Hello, I'm coming from a traditional strongly-typed background (C++ & Ada95)
and I'm trying to get a grasp on modern functional objects.
Why does this code give a run-time error?
define method fact (x) => ()
if (x = 1)
1;
else
fact(x - 1) * x;
end;
end method fact;
define method main () => ()
fact (5);
end method main;
begin
main();
end;
...if I give it all the typing info, it works but it seems to me it can
infer it in theory.
Am I completly misunderstanding?
BTW I'm using functional developer...
Follow-Ups: