> From: Christoph Reck [mailto:[EMAIL PROTECTED]]
> 
> Getting there...
> 
> A valid solution for me is to "Drop the key from the context 
> if the value is null".
> 

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? 

I really think NULL values on the right should be valid values.

See some other comments below:

> "Geir Magnusson Jr." wrote:
> > 
> > Christoph :
> > > My experience shows me these situations where a NULL can happen.
> > 
> > > a) The template designer has written an invalid identifyer:
> > >    #set( $foo = $bar.woobie )
> > >   where getWoobie() does not exists. here it is sufficient that
> > >  its logged...
> > 
> > Yes, that will be logged.  It is actually checked before 
> it's shoved into
> > the context, so the only issue there is that $foo is still 
> not in the
> > context if it wasn't, or unchanged if it is.  Maybe to 
> support the semantics
> > of 'no null references' we just remove $foo from the context ?
> 

Shouldn't we distinguish between NULL results and NON EXISTING results?
I would argue that in the example above, what we have is an error
on the evaluation of #set since getwoobie() does not exists. In such a case
we should not only log but we could also ignore the operation completely.
The same for #set($a = $a + "two"). This is an error.

> If you make 'no null references' configurable some others 
> will scream, 
> saying this will counteract velocimacro libraries...
> 
> >[snip]
> > right. Hm.  Maybe if you do what amounts to a #set( $foo = 
> <null value
> > returned from something> ) then we remove $foo from the 
> context if it is
> > there?  That would support the semantics, be predictable, etc.  
> 
> +1

As I said before what does this means in the case of chained contexts.
> 
> > This strikes
> > me as a little yecchy though, somehow, although in some 
> ways clean : there
> > are no null objects in the context.  


Jose Alberto

Reply via email to