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

Jim Fulton jim at zope.com
Wed May 19 17:01:57 EDT 2004


Casey Duncan wrote:
> On Wed, 19 May 2004 16:00:43 -0400
> Jim Fulton <jim at zope.com> wrote:
> 
> 
>>I've posted two proposals:
>>
>>   http://dev.zope.org/Zope3/TALESPathExpressionAdapters
> 
> 
> I have to say I am not found of "*",

I'm not attached to '*'.  Feel free to suggest alternatives
(other than ':', '/', '|', or '?'. Is that all ;)

 > but using the parenthesis to "cast"
> the variable seems fairly natural and isn't colored by completelt
> different meaning in other languages.
> 
> So the example:
>   tal:content="x/y*foo.bar.baz/z"
> 
> would be:
>   tal:content="x/(foo.bar.baz)y/z"

Yup

> Which seems reasonable. The dotted notation seems ok, but it implies
> that this notation is recognized in general in path expressions which is
> confusing because it isn't. If we didn't use dots then it might look
> like:
>   tal:content="x/(modules/foo/bar/baz)y/z"

I'm not sure what you mean here. If the thing in the parens was a
path expression, it would be:

   x/(modules/foo.bar/baz)y/z

IOW, modules excepts dotted names.

> If the thing in the parenthesis is just another path expression, that
> mitigates the need for namespaces IMO. The above could then become:
>   tal:define="baz modules/foo/bar/baz"
>   tal:content="x/(baz)y/z"

True, but then, the obvious syntax would be:

   x/baz(y)/z

which is the top of a slippery slope. :)

It would also make it harder to provide predefined adapter names.

We'd like to be able to define some adapters (e.g. 'zope', 'format', etc.)
in ZCML and let people just use them in ZPT without having to use defines.


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 ZPT mailing list