Say that we enter the following in the Racket REPL:
What is the result of the last expression?
Say that you’re working in a REPL of a Racket-like language, and you
have a box value in
(define x (box 1))
Consider the following expression:
(list (set-box! x (add1 (unbox x)))
Based on the result of this expression, you’ll be able to tell whether
… evaluates left-to-right or right-to-left.
… is eager or lazy.
… uses lexical scope or dynamic scope.
… returns the new value, the old value, or some useless value as a result of varaible assignment.
… returns the new value, the old value, or some useless value as a result of a box mutation.
… is statically typed or not.
In our new Toy Language what does this return?
Say that you have two types defined:
Which of the following is true:
(Listof Sub) subtype-of (Listof Super)
(Listof Super) subtype-of (Listof Sub)
T -> Sub subtype-of T -> Super
T -> Super subtype-of T -> Sub
Sub -> T subtype-of Super -> T
Super -> T subtype-of Sub -> T
Sub -> Sub subtype-of Super -> Super
Super -> Super subtype-of Sub -> Sub
(Boxof Sub) subtype-of (Boxof Super)
(Boxof Super) subtype-of (Boxof Sub)