Metaclass with name overloading.

Alex Martelli aleaxit at yahoo.com
Tue Sep 28 08:37:31 EDT 2004


Carlos Ribeiro <carribeiro at gmail.com> wrote:
   ...
> Generic templating mechanisms start as simple variable substitution
> engines, but as they start to be used, there's the need to add control
> structures (if, for, etc); it's also needed to provide more ways for
> the template to communicate with the main program, exchanging
> variables and values. At this point, wouldn't be better to write all
> templates in the main programming language of the system?

At this point, your templating is not declarative -- it's imperative.
Like everything in Python, btw -- not ONE 'declarative' in sight (except
the 'global' statement, which is part of what makes it a wart;-).

There IS a case for purely declarative stuff _embedding_ Python code,
like strakt.com's "blam" (purely informal name, as Strakt's marketing
may lot like it, we just can't keep saying "Business Logic Module
Language" forever;-) does for (basically) ERD + actions/triggers.  The
embedding makes the whole non-declarative, of course.  But the
declarative part can still be way prettier than it would be if it wasn't
a separate language, e.g. it could use such keywords as 'entity',
'relation', 'attribute' and the like...


Alex



More information about the Python-list mailing list