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

Jim Fulton jim at zope.com
Thu May 27 07:16:39 EDT 2004


Casey Duncan wrote:
> On Fri, 21 May 2004 09:07:24 -0400
> Jim Fulton <jim at zope.com> wrote:
> 
> 
>>Jim Fulton wrote:
>>
>>>I've posted two proposals:
>>>
>>>  http://dev.zope.org/Zope3/TALESPathExpressionAdapters
>>>
>>>Proposes a mechanism for easily using adapters in TALES expressions.
>>>
>>>  http://dev.zope.org/Zope3/ZPTVariableNamespaces
>>>
>>>proposes a mechanism for qualifying names defined in TAL and used in
>>>TALES expressions.
>>
>>Based on initial comments, I've retracted ZPTVariableNamespaces and
>>updated:
>>
>>   http://dev.zope.org/Zope3/TALESPathExpressionAdapters
>>
>>I've thrown out a few more spellings for adapter use:
>>
>>   ob->adaptername      context->dc/title
> 
> 
> Hmm, C style, kinda nice, except the use of angle brakets might make
> like difficult. 

">" is not a problem. "<" would be a probkem.



> It really is hard for me to see the intended order of
> execution of this as well. It reads "context to dublin core, get title".

That's exactly right.  The order, left to right, is very simple.

The problem with:

    (dc)context/title

is that the order is: skip one, right to left, then left to right. The order is
more complicated, except that there is an alternative left to right
interpretation ...


> Having dublin core go first makes more sense to me so it would read
> "with the dublin core of context, get title". 

So, here you thinking of this as:

   start with the dublin core protocol
   adapt it from context
   get title

...

>>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.
> 
> 
> It's all in the eye of the beholder I guess. This says to me "d of c
> (modified by adapter) of b of a".

Wow :)

But this seems wrong. It's really "(c of b of a) modified by adapter".

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