Movatterモバイル変換


[0]ホーム

URL:


[Python-Dev] #pragmas in Python source code

gvwilson@nevex.comgvwilson@nevex.com
Wed, 12 Apr 2000 17:01:04 -0400 (EDT)


> Ka-Ping Yee wrote:> Python isn't just a parse tree.  It has semantics.> XML has no semantics.  It's content-free content.  :)Python doesn't even have a parse tree (never mind semantics) unless youhave a Python parser handy.  XML gives my application a way to parse yourinformation, even if I can't understand it, which is a big step over (forexample) comments or strings embedded in Python/Perl/Java source files,colon (or is semi-colon?) separated lists in .ini and .rc files, etc.(I say this having wrestled with large Fortran programs in which asizeable fraction of the semantics was hidden in comment-style pragmas.Having seen the demands this style of coding places on compilers, andcompiler writers, I'm willing to walk barefoot through the tundra to getsomething more structured.  Hanging one of Barry's doc dict's off a moduleensures that key information is part of the parse tree, and that anyonewho wants to extend the mechanism can do so in a structured way.  I'dstill rather have direct embedding of XML, but I think doc dicts are stilla big step forward.)Gregp.s. This has come up as a major issue in the Software Carpentrycompetition. On the one hand, you want (the equivalent of) makefiles to belanguage neutral, so that (for example) you can write processors in Perland Java as well as Python. On the other hand, you want to have functions,lists, and all the other goodies associated with a language.


[8]ページ先頭

©2009-2025 Movatter.jp