## Question 1 @ 2022-10-11 18:46

Which of the following are true about different treatments of functions
in programming languages?

FOV. First order: functions can be used as *values*
FOS. First order: function values can be created in any scope

HOV. Higher order: functions can be used as *values*
HOS. Higher order: function values can be created in any scope

FCV. First class: functions can be used as *values*
FCS. First class: function values can be created in any scope

## Question 2 @ 2022-10-11 18:50

What would be the result of running this expression using our Flang
language implementation (the one with substitutions)?

{with {+ *} {+ 1 2}}

- Compilation error
- 2
- 3
- Unbound
`+`

error
- Unbound
`*`

error
- bad
`with`

syntax in

## Question 3 @ 2022-10-11 18:57

Given the following code and one sample test:

(define (fix1 f x)

(lambda (y) (f x y)))

(test ((fix1 mul 10) 5) => 50)

Which of the following type declarations is best for `fix1`

?

- (: fix1 : (All (A B) (A A -> B) -> A -> B))
- (: fix1 : (All (A B) (A A -> B) A -> (A -> B)))
- (: fix1 : (All (A B C) (A B -> C) A -> (B -> C)))
- (: fix1 : (All (A B C) (A B -> C) -> (A -> (B -> C))))
- (: fix1 : (All (A B C) (A B -> C) -> A -> (B -> C)))
- (: fix1 : (All (A B C) (A B -> C) (A -> B) -> C))

## Question 4 @ 2022-10-11 19:05

Reminder: all the way from AE to FLANG, we implement arithmetic
operations like `+`

with

[(Add l r) (+ (eval l) (eval r))]

The question is whether our language is evaluating these expressions
left-to-right or right-to-left?

- LtR
- RtL
- Either LtR or RtL; it’s nondeterministic so we cannot tell which one.
- Whatever it is that Racket does.
- The question is nonsensical: our languages are unrelated to Racket.
- No way to answer, since it depends on how the CPU optimizes the order.

## Question 5 @ 2022-10-11 19:15

Are the following FLANG expressions equivalent?

A. {+ E1 E2}
B. {with {x E1} {with {y E2} {+ x y}}}
C. {with {y E2} {with {x E1} {+ x y}}}

Choose all of the correct statements.

AB. A is equivalent to B
AC. A is equivalent to C
BC. B is equivalent to C

W1. All would be equivalent if this is limited to WAE
W2. All would be equivalent if this is limited to WAE without division