PLQ #12Done on:   Tuesday, April 9th

Question 1 @ 2024-04-09 19:13

What is the biggest problem of using just syntax-rules as your macro tool of choice?


Question 2 @ 2024-04-09 19:16

Considering how adding an excess of macros can make code harder to read, debug, and possibly use — which of the following is the least compelling reason to implement a macro?


Question 3 @ 2024-04-09 19:18

Of the following, which are valid reasons for using a type checker?


Question 4 @ 2024-04-09 19:20

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


Question 5 @ 2024-04-09 19:23

Consider the evaluation rules for our new PICKY language, which started as a simple extension of the old FLANG language:

eval(N,env)                = N
eval(x,env)                = lookup(x,env)
eval({+ E1 E2},env)        = eval(E1,env) + eval(E2,env)
eval({- E1 E2},env)        = eval(E1,env) - eval(E2,env)
eval({= E1 E2},env)        = eval(E1,env) = eval(E2,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(B,extend(x,eval(E2,env1),env2))
                            if eval(E1,env1) = <{fun {x} B}, env2>
                          = error!  otherwise <-- never happens
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

How should these evaluation rules be revised to fit the Picky statically-typed context?