[Zope-dev] Re: simpler TALES. (was Re: TALES idea: tuple unpacking)
Shane Hathaway
shane@zope.com
Wed, 30 Jul 2003 14:29:45 -0400
Paul Winkler wrote:
> On Wed, Jul 30, 2003 at 02:06:13PM -0400, Shane Hathaway wrote:
>
>>Evan Simpson wrote:
>>
>>>With prefixes, the simpler
>>>"here/getSomeObject/call:/someAttribute" gets the job done.
>>
>>FWIW, I'd write this as "here/call:getSomeObject/someAttribute". I
>>suppose it's possible to support both.
>
>
> really? How? If you support evan's version, then yours means
> "call whatever 'here' refers to, and pass getSomeObject as an argument".
No. I can see how you interpreted it that way, though. "call:" is
intended to be a method call, and Evan has provided a way to make it a
function call also. In either case, you never pass any arguments. I
see the expression "x/call:y" as "call the method named 'y' of 'x'". If
no 'y' is provided, as in "x/call:", it means "call 'x'".
>>One interesting difference is
>>that my syntax says both "get an attribute" and "call it", while yours
>>says only "call it". Mine is a method call, while yours is a function call.
>
> How would you pass arguments in your version? I'd say that passing
> arguments accounts for a very large percentage of my need to use
> TALES python expressions.
If you need to pass arguments, use a Python expression. Python
expressions are not on trial.
If you need to pass exactly one argument, you can use a prefix that
implies that. "format:", as I've been using it, is one such prefix.
Shane