From: Jesse Jones Date: 2004-08-05T06:11:30+09:00 Subject: Re: Macros in Ruby In article <411108CE.5060805@ieee.org>, Steven Jenkins wrote: > Jesse Jones wrote: > > In article <41102A98.806@infofiend.com>, Ben Giddings > > wrote: > >>I'm sorry to say it, but I think you just proved Matz' point there. I > >>look at that, and it doesn't look like Ruby to me. > > > > It's not Ruby. It's a little domain specific language (DSL) tailored to > > a particular problem. > > I don't have an opinion on macros per se, but DSLs are (in my opinion) a > poor application for macros. To paraphrase Dennis Ritchie, if you want > racc, you know where to find it. > > I'm a big fan of DSLs, but I like to build them up from the grammar. Which is *exactly* what Dylan macros do. When you define a new Dylan macro you're directly extending Dylan's grammar. But, unlike racc, your domain specific language is integrated into the base language and you can use the compiler to handle lexing and parsing. Here's a Scheme paper that contrasts the traditional approach to DSLs with a macro based one: . -- Jesse