Take the following WAE expression:
Which kind of an identifier is the FIRST occurrence of x
?
Take the following WAE expression:
Which kind of an identifier is the SECOND occurrence of x
?
Take the following WAE expression:
Which kind of an identifier is the THIRD occurrence of x
?
The scope of an identifier…
Last time, we have seen the implementation of the WAE evaluator,
specifically, this was the evaluation fragment for with
:
We saw that there is a simple way to make it into a lazy binder. How do we do that?
eval
in the last line.Num
in the last line.Num
and the eval
in the last line.subst
around the named-expr
too.subst
, which needs to always go
into the named-expr
part.Alice has excited about intsets from HW#2, so she wrote some code to find out the length of a (normalized) set:
Bob says that Alice should add an else
clause:
Is this correct?
A. No.
B. Yes.
C. No, adding an else
will essentially remove the advantage we get
from the Type checker.
D. Yes, we need to cover all possible cases. An else
clause will help
covering additional cases if the INTSET type gets extended.
E. No, because adding an else
will cause a type error.
F. Yes, adding an else
is always a good idea, especially for
conditionals in a Typed language.