Movatterモバイル変換


[0]ホーム

URL:


If you want X, you know where to find it (was Re: do...until wisdom needed...)

Douglas Alannessus at mit.edu
Thu Apr 19 02:31:57 EDT 2001


Courageous <jkraska1 at san.rr.com> writes:> >   @let x = 3> >where "@" means that a macro invocation is coming up.> Hrm. Don't think so. Any hypothetical Python-native macro utility> should be very tightly integrated such that it allows you to create> your own special-purpose dialect of the language on a per-project> basis if need be. One of the appeals of utilities like this is to> map domain-specific capabilities directly onto a computer> programming language. Tis one of the lasting contributions of Lisp> to the programming community, it is.I'm not sure I see how having macro invocations stand out *slightly*violates any of this.  I've never quite liked the fact that in Lispyou may have trouble telling a procedure call from a macro invocation,considering that the semantics can be quite different.  It's nice formacros that make their way into every day use, like "loop", sinceyou'll recognize the name instantly.  But it's not quite as nice whenthe macro is a bit more obscure.  On the other hand, if "loop" hadbeen called "@loop", instead, I wouldn't have lost any sleep over theinconvenience of having to type that "@".Perhaps in Python you could get away without having any special macroinvoking syntax, but since I know nothing about how the Python parseris implemented, I have no idea how easy or hard that might be.  Isuspect you *could* get away without any special macro invoking syntaxdue to the way that Python is rather line-oriented.  I.e., if a lineis not a continuation line, and the second token on the line isn't".", "=", "(", "+=", "+", etc., and the first token isn't a keyword,then look the first token up in the macro table.  I wouldn't bet mylife on this being workable without doing more research though.|>oug


More information about the Python-listmailing list

[8]ページ先頭

©2009-2025 Movatter.jp