Question 1 @ 2024-10-29 18:40
Identify all of the primitive value types in Schlac.
- Natural numbers
- Booleans
- Lists
- Functions
- Symbols
Question 2 @ 2024-10-29 18:43
What is the difference between a Y combinator in an eager language vs one in a lazy language?
- No difference
- The lazy version is more verbose
- The eager version is more verbose
- There is no way to compare the two, which makes this question nonsensical
Question 3 @ 2024-10-29 18:49
How do we evaluate a simple (one-argument) Schlac function call (aka “beta-reduction”) via substitution:
(Warning: consider which one is the best answer for Schlac.)
-
E1[x/eval(E2)]
-
E1[eval(E2)/x]
-
E1[E2/x]
-
E1[x/E2]
Question 4 @ 2024-10-29 18:50
The answer for the previous question was
are there any caveats to consider here?
(Same warning.)
-
If Schlac was eager, we would need to add an
eval
-
The substitution needs to be a proper one, not like the one we implemented
-
We need to add a protection there, to avoid an infinite loop.
-
None, this is a straightforward rule.
Question 5 @ 2024-10-29 18:52
In Schlac (limited, lazy, auto-curried), with the church encodings and arithmetic functions, what would the following
1 2 3))
evaluate to?
1, 2, 3, 4, 6, 8, 9, 12, 18, 27, Error