Consider this segment of code which was part of our work on turning
eval
into a compile
:
Which of the following is FALSE?
The environment is a place to only hold values at run-time.
We used currying to split the two arguments into the compile-time and run-time information.
This is a proper compiler because no compiler calls happen at runtime.
With this definition, work is done at compile-time because the
code identifies and deconstructs the If
structure, then creates a
runtime closure.
To turn this into a proper compiler, the cond-expr
should be
pre-compiled.
To turn this into a proper compiler, the then-expr
and
else-expr
should be pre-compiled.
What is the result of the following:
Nothing: it gets stuck in an infinite loop.
Nothing: it will run for a while and abort with a stack overflow.
It will result in a syntax error, since the value of a
is not
initialized so it cannot refer to itself.
There is no way for this to work as-is, but if we applied the Y combinator, we would get 1.
1
0
An infinite list of ones: #0=(1 #0#)