Metasyntax/Macros

Terry Reedy tjreedy at udel.edu
Wed May 14 13:43:09 EDT 2003


"Paddy McCarthy" <paddy3118 at netscape.net> wrote in message
news:2ae25c6b.0305140003.dbd812e at posting.google.com...
> I went googling for messages on Python and adding a macro facility,
> but ended up with just too many hits and got lost.
>
> The reason I was looking was that I can get envisage an application
> but seemed to remember that the addition of macros to Python got
shot
> down before but could not remember the reasons.

They are all in the hits you gave up on ;-)  (Try just those in 2002.)
One quick summary is that Guido wants Python code to look like Python
code and be more or less universally readable by other Python
programmers.  He is not going to be the one to help fork Python into
separate sublanguage communities.

> specific languages such as Specman and Vera. If Python was that
higher
> level language then i thought that a macro facility would allow some
> of the domain specific languages syntax to be re-used , People could
> write
>
>  module my_mod (x,y,z) ...
>
> and create a Python class.

This shows the problem already.  'Module' is already in use to refer
to modules, which are different from classes.  If a person has such a
misunderstanding, what will they make of sys.modules?  -- or of the
word 'module' in all current Python
writings.

You can, of course, use the C preprocessor or equivalent to make such
word-to-work translations before feeding the result to a Python
interpreter.

Terry J. Reedy






More information about the Python-list mailing list