[Zpt] What is the behavior here?

Todd Coram todd@digicool.com
Fri, 2 Mar 2001 09:40:07 -0500


>
> > <span tal:define="text str:Anything, structure /here/something">
> >   <p tal:insert="text" />
> >   <p tal:replace="structure" />
> > </span>
> >
> > Is there a problem with our keyword modifiers "global", "text", and
> > "structure" clashing with variables and thus creating ambiguity?
>
> I don't find it a problem -- you can always use the keyword explicitly.

Yes. The explicit case is no problem, but what is the implicit behavior?

If no error, then

<p tal:insert="text" />

is really interpreted as:

<p tal:insert="text text" />

and

<p tal:replace="structure" />

is

<p tal:replace="text structure" />

This is fine with me, but it means that we sniff for variables before the
literal interpretation of the modifiers (structure & text).

Or, should it generate an error?:

<p tal:insert="text" /> would generate 'missing variable'
<p tal:replace="structure" />  would generate 'missing variable'!

-- todd

>
> I see no problem with "global" -- this is only used when *defining* a
> variable.  There's now no explicit way to reference a global that's
> hidden by a local -- that's fine with me!  (The template designer did
> this to itself.)
>
> --Guido van Rossum (home page: http://www.python.org/~guido/)
>
> _______________________________________________
> Zpt mailing list
> Zpt@zope.org
> http://mail.python.org/mailman/listinfo/zpt
>