Jose Alberto Fernandez wrote:
> [SNIP]
> > > How will this work with the new chained Contexts that have
> > been proposed?
> > > Does it goes and removes any previous occurrence in the
> > chain? Will it just
> > > make any previous occurence available?
> >
> > That is an issue we have to work out.  I think no, we should treat the
> > chained contexts as 'read only'.  Since you can't put() into a chained
> > context (the put() operation only affects the local or 0th level
> > context), you can't remove() either.
> >
> 
> Well this is exactly my point. Christoph's solution of simply removing the
> context entry does not work. Why?, because it would expose the old value
> after the set operation which, I think is the more confusing behavior we can
> have.

Hm.  It would expose a value in a chained context if it exists.

> > > I really think NULL values on the right should be valid values.
> >
> > Why?  What do you get with that? Can you give me an example?  I just
> > don't see where this would be useful information.  Don't read this as
> > some sort of challenge - I am just curious where this would
> > be useful to
> > you.
> >
> 
> Well, probably the most useful information that they provide is that a valid
> #set operation was performed and that it produced no value. Hence it can be
> used to differentiate between no-value and no-definition.

Hm.  I agree that there is a difference, and to some degree it's
important.  I wonder, though, if its more important to keep things
simple for the template creator.  You do quite advanced templates.  I
don't think the average user would come close to what you come up with.
 
> My point is not that much how we treat null values (what we do when we found
> one, #if, etc.) but how the Contexts manage them.

Yes, that's the whole thing here...

>[SNIP]
>> > The same for #set($a = $a + "two"). This is an error.
>> 
>> That is an error, and is logged as such, as a type incompatibility for
>> the operation.  Right now, $a is not altered in the context, 
>> as that is
>> our convention, and that's what we are talking about changing.
 
> Why should be invoking a non existing property or method treated any
> different.

It already is, actually, when you think about it.  You can have
$foo.woobiewoobiewoobie in a template, and if $foo is in the context,
and is a string "warg", then it would render as warg.woobiewoobiewoobie.

Now, this is different in a #set directive, as the .woobie... is no
longer treatable as schmoo, because the RHS of the = in a #set() must
not have dangling schmoo.


-- 
Geir Magnusson Jr.                               [EMAIL PROTECTED]
Velocity : it's not just a good idea. It should be the law.
http://jakarta.apache.org/velocity

Reply via email to