> 1. Our interpreter carefully checks that the number of arguments
passed to a function matches the number of parameters it expects. Since
this check is done at runtime on every call, it has a performance cost.
Smalltalk implementations don’t have that problem. Why not?
Because the arguments are part of the function signature.
> 1. A few chapters from now, when Lox supports first-class functions and dynamic
dispatch, we technically won’t need branching statements built into the
language. Show how conditional execution can be implemented in terms of those.
Name a language that uses this technique for its control flow.
Smalltalk? Lox doesn't have dictionaries, but in Ruby:
```ruby
def if_(cond, t, f)
{ true => t, false => f }[cond].()
end
```
> 2. Likewise, looping can be implemented using those same tools, provided our
interpreter supports an important optimization. What is it, and why is it
necessary? Name a language that uses this technique for iteration.
Tail recursion, Lisp?
FossilOrigin-Name: aec62b2632ecda95e950b0ea1a2cc7605db12f28cbbaf579f62519a4d5679aa4