PLQ #12Done on:   Tuesday, April 13th

Question 1 @ 2021-04-13 18:37

Consider how adding an excess of macros can make code harder to read and debug. Which of the following is the least compelling reason to implement a macro?

Question 2 @ 2021-04-13 18:40

Recall the PICKY language we went over in class last week. Which one of these statements about the type judgements/rules of our PICKY language is not true?

Question 3 @ 2021-04-13 18:44

Which of these is not a valid reason to use a type system?

Question 4 @ 2021-04-13 18:57

Consider the evaluation rules for the PICKY language:

eval(N,env)                = N
eval(x,env)                = lookup(x,env)
eval({+ E1 E2},env)        = eval(E1,env) + eval(E2,env)
eval({fun {x} E},env)      = <{fun {x} E}, env>
eval({call E1 E2},env1)
        = eval(Ef,extend(x,eval(E2,env1),env2))
                          if eval(E1,env1) = <{fun {x} Ef}, env2>
        = error!          otherwise -- but this doesn't happen
eval({with {x E1} E2},env) = eval(E2,extend(x,eval(E1,env),env))
eval({if E1 E2 E3},env)    = eval(E2,env)  if eval(E1,env) is true
                          = eval(E3,env)  otherwise

Do we need to add types to these rules?

(Choose the best answer.)