Movatterモバイル変換
[0]ホーム
do...until wisdom needed...
Andrew Dalkedalke at acm.org
Tue Apr 17 22:37:15 EDT 2001
Douglas Alan wrote:>For instance, procedural macros allowed Lisp to turn itself from a>procedural language to an OO language without changing the language at>all. A very capable OO extention (one that supported multimethods and>a meta-object protocol) could be added to the language using only>macros. The language was able to *grow* without any centralized>control.Here's me asking for clarification on the meaning of "proceduralmacros" again. Would Tcl be considered a language based almostentirely on procedural macros? It let you introduce your ownloop constructs, classes, exception framework, etc.Quoting Steve Lamb:>> Redefining the very semantics and syntax of the language means it is>> a new dialect.>>Procedural macros don't allow you to "redefine the very semantics and>syntax of the language". They only allow you to add new terms to the>language, just as defining functions and objects allows you to add new>terms.At one of my clients there are at least three different vocabulariesfor essentially the same thing - the words used in the literatur,the words used by the chemists and the words used by theimplementation of the chemists viewpoint on a computer.The software suffers as a consequence because aliases for the sameideas are used through the system and docs, and there isn't aprecise idea of when one word should be used over another.I've always been concerned about languages which allow you todefine new terms to the language because it would just exacerbatethe language problems people already have.> The type of term you can add to Python with a function is>somewhat limited compared to what you could add with procedural>macros. Sometimes a more powerful term-adding capability is>incredibly useful and allows you to make programs that are more>elegant and easier to maintain.Perhaps, but my feeling is that the level of training you needfor that is greater than most of my clients - chemists andbiologists - want to go through. Note that since I've neverused a language (other than Tcl?) with these sorts of macrosI don't have specific knowledge of the pros and cons.I can say that in Tcl I rarely saw researchers without a verystrong background in CS (degree level) defining their ownnew language constructs. Also, the lack of a *standard* wayto do objects (this is back in the 7.x days) meant that noone used them - no one rolled their own OO system.I can also point out the almost complete nonexistence of amajor package in computational chemistry or biology writtenin a language supporting hygenic/procedural macros as anindicator that *something* prevents their wider use in myfield. Andrewdalke at acm.org
More information about the Python-listmailing list
[8]ページ先頭