[Python-3000] symbols?

Guido van Rossum guido at python.org
Sun Apr 16 22:06:45 CEST 2006


On 4/14/06, Kendall Clark <kendall at monkeyfist.com> wrote:
> Fair enough. My primary use case is using Python as a host for a
> Domain Specific Language. [...]

Then I suggest that having a good syntax is important; you don't want
your DSL to look ugly because that would not contribute to having fun.

Let's assume that !foo can be used as a symbol; it's ugly but perhaps
not too ugly; and we can pick a better character later. I propose you
(or someone else who would like to see this happen) an experiment:
write a lexer + parser extension that implement this; write a symbol
object type implementation that behave the way you want it to; and
then use it to implement a mid-size DSL (two or three would be even
better).

Then, with this experience under your belt, you can report back and we
can decide whether this really is a valuable addition.

I know this is a lot of work to ask the proponents to do. But hey, if
you don't want to do the work, well, I don't either, so it won't
happen, so you certainly won't get your feature. If you do the work,
you might have to quit at any time because there's a flaw to the idea;
that would be a useful result and you will have learned something (and
hopefully you'll pass back the information so we'll all learn). Or you
might end up with something so Pythonic and useful that I would be a
dick not to accept it as a new feature. Do we have a deal?

PS. On my recent tendency to request code instead of PEPs, see my PS
recently to another thread in this list.

--
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list