1-11

Code as data is the future of DSLs

# Describe the end result

->(foo, bar) {
  div {
    h1 foo
    p bar
  }
}


# Describe the operations to be done

->(__buffer__, foo, bar) {
  __buffer__ << '<div><h1>'
  __buffer__ << ERB::Escape.html_escape(foo)
  __buffer__ << '</h1><p>'
  __buffer__ << ERB::Escape.html_escape(bar)
  __buffer__ << '</p></div>'
  __buffer__
}