[Zope3-dev] ? vs $
Jim Fulton
jim@zope.com
Fri, 14 Jun 2002 14:43:09 -0400
"Barry A. Warsaw" wrote:
>
...
> If you're worried about colliding with identifiers that start with $,
> write
>
> <span tal:replace="context/${jobid}/summary">...
>
> Probably a low likelihood of collisions (and if so, use $$ to
> disambiguate). I think it's more important to make similar operations
> look similar so it's clear at first glance what the intention is.
This reminds me of another reason that '?' was used.
We really didn't want to allow arbitrary string substitution because the
semantics get a but squishy.
foo/?bar
means traverser foo with the name contained in bar, no matter what
characters were in the name.
Suppose the value of bar is "baz/splat". I might
expect:
foo/$bar
to be equivalent to:
foo/baz/splat
but part of the value of foo/?bar is that it
allows you to use '/' in a name.
Consistent use of syntax is a bad thing when the semantics are different.
Jim
--
Jim Fulton mailto:jim@zope.com Python Powered!
CTO (888) 344-4332 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org