Say that we’re using a(n infix) language that implements =
assignments. It can be said that the expression

x = y = x

swaps the values of x and y. Given this (and that all of the
expressions in our language evaluate to some value) what must an
assignment expression evaluate to in our language?

A bogus value

The new value that was assigned

The old value (before the assignment)

Question 2 @ 2021-03-16 18:34

Say that we’re using a(n infix) language that implements =
assignments. It can be said that the expression

x = y = x

swaps the values of x and y. Given this (and that all of the
expressions in our language evaluate to some value) we know that
assignment expressions evaluate to the old value.

What did we assume to make that conclusion?

The language is statically typed

The language is eager

The language is lazy

The language is compositional

The language is compiled

Question 3 @ 2021-03-16 18:37

A Mod2Digit is one of: 0, 2, 4, 6, 8

A Mod4Digit is one of: 0, 4, 8

Which of the following subtype relations hold?

(T1 ⊂ T2 means T1 is a subtype of T2; Select all that apply.)

(Listof MOD2Digit) ⊂ (Listof MOD4Digit)

(Listof MOD4Digit) ⊂ (Listof MOD2Digit)

T -> MOD2Digit ⊂ T -> MOD4Digit

T -> MOD4Digit ⊂ T -> MOD2Digit

MOD2Digit -> T ⊂ MOD4Digit -> T

MOD4Digit -> T ⊂ MOD2Digit -> T

(Boxof MOD2Digit) ⊂ (Boxof MOD4Digit)

(Boxof MOD4Digit) ⊂ (Boxof MOD2Digit)

Question 4 @ 2021-03-16 18:42

What will be the result of the following test for the with in HW10?