[Zope] inconsistency in tag argument syntax
Michael Bernstein
mbernstein@profitscape.net
Fri, 08 Oct 1999 12:31:15 -0700
"Jay, Dylan" wrote:
> > From: Michael Bernstein [mailto:mbernstein@profitscape.net]
> >
> > "Jay, Dylan" wrote:
>
> > > 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?
> >
> > If you want to provide dynamic atributes for all tags, the
> > "&dtml-foo" entity
> > syntax would be more appropriate, and would avoid breaking current
> > implementations (I think). You would just have to assign the
> > value of your
> > expression to foo beforehand.
>
> Are you saying that
> <dtml-let orderby="'aFieldName'">
> <dtml-in aList sort=&dtml-orderby>
> </dtml-in>
> </dtml-let>
>
> will work? I don't think this is the case. From looking at the code I saw no
> place where this happens.
No, I'm saying that this (name="&dtml-orderby") would be a better option than
(b) for evolving to a situation where all attributes can be dynamically
assigned, and would avoid breaking existing code, constants can continue to look
like name="name".
HTH,
Michael Bernstein.