looking for tips on how to implement "ruby-style" Domain Specific Language in Python

Jonathan Gardner jgardner at jonathangardner.net
Thu Jan 8 00:40:37 CET 2009


On Jan 7, 9:16 am, "Chris Mellon" <arka... at gmail.com> wrote:
>
> The OP wants a Ruby-style DSL by which he means "something that lets
> me write words instead of expressions". The ruby syntax is amenable to
> this, python (and lisp, for that matter) syntax is not and you can't
> implement that style of internal DSL in those languages.
>
> The answer to the OP is "you can't - use Ruby or modify your requirements".
>

As far as putting the code into Python, yeah, you can't put it in
Python. The best you can do is store it in a string and then interpret
the string with some function later on.




More information about the Python-list mailing list