Sorry, that's why I had quote around my parse. I meant, use clojure reader to take a sequence in a macro and then "parse" it for my own DSL. So I shouldn't need any help from the reader (even if having some metas with line and character attached to thing would help)
I do not want to go the parser generator way because I want the DSL to be tightly integrated with Clojure. Thanks for your answer, Nicolas. On Thu, Jul 8, 2010 at 8:15 PM, Michael Gardner <gardne...@gmail.com> wrote: > On Jul 8, 2010, at 1:52 PM, Nicolas Oury wrote: > > > I am trying to write a small Domain Specific Language using macro, and I > want the syntax of the args of the macro to be somehow "parsed" and > transformed. > > > > So, I have two questions: > > > > - Does anybody else does that? (except the infix calculus) Is there a > generic method for doing it? Or even better a library? > > The generic way to create parsers is with a parser generator. You describe > your grammar (usually in something like Backus-Naur Form), and it creates > code that will parse strings using that grammar. > > But (somebody correct me if I'm wrong here) to do something like you > describe would require a custom reader macro, which Clojure doesn't > currently support. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com<clojure%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en