[Zope-dev] Re: [Zope3-dev] Re: [ZPT] Re: RFC: TALES adapters and TAL/Tales variable namespaces

Jim Fulton jim at zope.com
Thu May 27 06:28:34 EDT 2004


Ian Bicking wrote:
> Jim Fulton wrote:
> 
>> One disadvantage I see with the cast notation is that it's
>> a bit jarring in:
>>
>>   a/b/(adapter)c/d
>>
>> as the adapter is applied to a/b/c. The order just doesn't
>> seem quite right.
> 
> 
> That is indeed jarring, especially since c isn't an object, it's just a 
> name, and a/b/c is the object in question.  This would look somewhat 
> better with the current : mechanism, like a/b/c:adapter/d
> 
> My concern with this use of : was that it looked like it should be 
> parsed like (a/b/c):(adapter/d), as opposed to ((a/b/c):adapter)/d -- 
> maybe using something other than : wouldn't imply this grouping.  Or 
> maybe if I got used to it the grouping would seem more natural.  I guess 
> my intuition is that / binds more closely than : (even if there isn't 
> any real precedence at all in TAL expressions).

Yes, this is another issue.  I have the same problem, somehow, with
"foo/bar->dc/title". That is "/" seems to bind more closely than "->",
probably because it's skinnier. :)  I don't have this problem with ":".


Another option is to modify the "/". For example, Evan sugested "/*", as in

   foo/bar/*dc/title

Hm

   foo/:dc/title

Sandly, nothing really jumps out as the best syntax.

So far, I like:

   foo/bar->dc/title

the best.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org




More information about the Zope-Dev mailing list