[Zope-dev] inconsistency in tag argument syntax

Jay, Dylan djay@lucent.com
Thu, 7 Oct 1999 17:32:46 +1000


After playing around with making a tag an inconsistency in the tag syntax
became apparent to me. Sometimes "asd" is treated as an  expression and
sometimes as a string. e.g.
<dtml-let blah="aObject.method()"> is an expression however
<dtml-mime name="aObject.method()"> makes the name argument a string with
'aObject.method()'
This is confusing and inconsistent. Also treating any argument always as a
string means that the value of the argument can never be dynamically
specified i.e. there is no way I could name a mime block dynamically e.g.
from a form. The same applies for instance to the 'sort' argument in
<dtml-in>. This is very limiting.

The problem is however that I can't see a backwards compatible way of fixing
this problem. Alternatives are 
a) You could introduce a evaluate expression syntax like there is in sh
script. i.e. name="`myMethod()`". This however makes things more confusing
and unreadable. 
b) Another possibility is to make all "non-expression" arguments become
expression arguments. This would break existing code and mean all string
constants look like name="'A name'" which is also not intuitive and messy.
This could be made cleaner by allowing syntax such as name='A name'.
c) Or ignore the problem.

I prefer option b).
What do other people think?