Posted by Steve VanDeBogart on February 18, 2004 at 03:34:39:
In Reply to: Re: pub5.scm posted by V. Ramakrishna on February 18, 2004 at 03:01:34:
: Just as a follow-up, at least according to my program, your type specified in the original pub5.scm is also wrong. My code generates (t1->(t2->int)).
I get that pub5.scm does not type check. If you consider the alternatives, what was said for set! is the only thing that's reasonable. It's two arguments must be of the same type, and that is the type that it returns.
If you were to have a set! as the then clause of an if and you were changeing the type of the variable, there would be no way to statically type check the program. However, if you require that the identifier and the expression in the set! be of the same type, the situation above still makes perfect sense and type checks fine.
: A side issue: Do the numbers of the variables matter? (For example, can I output the above answer as (t10->(t3->int)) ?)
No, it doesn't matter. (He's said this elseware)
--
Steve