You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to proglang-course-2011
Q3 for which the answer is
infer env (exp1 + exp2) =
typ := infer env exp1
check condition (typ == int || typ == double)
check env (exp2 : typ)
return typ
Are we here assuming an implicit Err-monad where each statement's
failure is taken care of? I mean, what if the type of exp1 cant be
inferred? Or else, what if the type of exp1 is neither int nor double?
The question says "the rule has to return a type". Maybe they meant it
should return a type as long as it doesnt return an error?
Arnar Birgisson
unread,
Mar 15, 2011, 7:52:50 AM3/15/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to proglang-c...@googlegroups.com, Hugo
Hi,
Yes, in the answer implicit error handling is assumed. I.e. if either of the check commands fail, the whole rule fails.