read-eval-print loop
how you interact with a scheme interpreter
- read
gets the sequence of keystrokes
eliminates irrelevant formatting, eg extra spaces (“lexing” or “scanning”)
recognizes shape of expression (“parsing”)
- eval
determines the value of the expression
- print
concocts some string representation of the value
displays it
- loop: start again
when things go wrong
- (if if) fails in the read phase
- (5 5) fails in the eval phase
variations on a scheme
- print phase varies amongst scheme implementations
- result of eval is determined by R4RS standard