4 ms·
How do all of these DSLs interact in close proximity? Ruby seems to do DSLs via a lenient lexer, rather than an explicit "quoting" mechanism, which means there
by silentbicycle 16y ago
How do all of these DSLs interact in close proximity? Ruby seems to do DSLs via a lenient lexer, rather than an explicit "quoting" mechanism, which means there isn't a way to locally specify a context for its idioms.
- philwelch 16y agoIt doesn't turn out to be a big problem since you don't generally mix idioms in the same file. In a Rails app, it's pretty easy to figure out which files are evaluated by which DSL. If you're using HAML, anything in app/views with a .haml extension is HAML. Anything under /spec is Rspec. Capfile, Gemfile, and Rakefile are self explanatory. routes.rb uses the Rails routing DSL.
- silentbicycle 16y agoAll right. Thanks for the polite and detailed response.