Scheme from Scratch - Bootstrap v0.14 - Begin
The last few days have been some meaty implementation steps. Today is quite light with the implementation of the
Sample REPL session:
$ ./scheme Welcome to Bootstrap Scheme. Use ctrl-c to exit. > (begin 1 2 3) 3
begin form doesn’t introduce a new lexical scope like a
lambda does but
begin does have a tail position that must be handled correctly.
As noted by readers in the comments below, a compound procedure has an implicit
begin form for the body of the procedure. The procedure application portion of
eval can be refactored to use this fact. I’ve made this change to the code. Perhaps introducing
lambda would have been a better pedagogical progression but I was getting impatient to get to
There is a v0.14 branch on github for this version.
Have something to write? Comment on this article.