Skip to content

Instantly share code, notes, and snippets.

@sawaken
sawaken / type0.rb
Created August 22, 2015 16:34
Scheme Interpreter Essensentials
# run on irb as follows.
# $ irb -r './type0.rb'
# irb> e [:define, :f, [:lambda, [:v], ["+", :v, 1]]]
# irb> e [:f 1]
# => 2
# ...
module Type0
Environment = Struct.new(:parent, :hash)
Lambda = Struct.new(:env, :params, :exp)