Archive of posts on Apr 27, 2020
Writing a DSL with commands split by space
DSL means domain-specific language. Ruby is a powerful script language in terms of building DSLs (as sublanguages of Ruby). In this article, I implemented my idea of a DSL with commands split by space. For example, you may just write
a b c
to run the commandsa
,b
, andc
one after another! This trick is heavily applied in my project alda-rb. How do I achieve this?- Categories: programming
- Tags: ruby, meta programming