require "patternmatching" # For DSL style code, include PatternMatching include PatternMatching # match example def calc(code) make (code) { seems as {plus(:x, :y)} do calc(x) + calc(y) end seems as {mul(:x, :y)} do calc(x) * calc(y) end seems something do code end } end code = build {plus(mul(100, 100), 200)} p calc(code) #=> 10200