Nathan Bubna <[EMAIL PROTECTED]> wrote:
> -0  i'm not totally against it, but i'm instinctively uncomfortable
> with using this programming concept in a template language. 
> personally, i've always felt in a display-oriented language, null and
> the empty string should be totally equivalent.  but that is already
> not the case, so i can't really be -1 on this.

Tim Colson <[EMAIL PROTECTED]> wrote:
> +1, although, like Nathan... I'm also a little nervous with a View layer
> 'knowing' about nulls. But I think it's a necessary evil, and already 
there
> with lots of workarounds. So I'm in favor of making it clearer. 
> ... I am not sure I want to tell my template folks about "null" ;-)

If you're already treating null as "", none of this stuff should break 
backwards-compatibility.
And there's no requirement to tell your templaters about null unless you're 
actually using it.

Null's more than a programming concept.  Translate Strings into books:   If 
I have no book, that's different from having a book with no writing in it.  
>From the point of view of "knowledge", they're the same, but if you're 
counting books, they aren't.

I still see absolutely no way a person can justify having #set and #foreach 
ignore nulls.  It doesn't "work" if you consider null to be functionally the 
same as an empty string.  It provides NO utility.  If you use it in a 
#foreach loop, null means repeat the last operation!  I could almost buy it 
if it set the value to "" rather than leaving it unchanged.

It reminds me of the old apple II disk copy protections.  The hardware 
couldn't read more than a certain number of consequetive zero bytes 
accurately, and if such a condition appeared on your disk, you had no way of 
knowing how many zeros you read.


Tim Colson <[EMAIL PROTECTED]> wrote:
> What would happen for these cases?
> #if ($!foo == null) 
> 
> Would position have any effect (i.e. like in Java to avoid NPE's) ?
> #if (null == $not_in_context)
> #if (null == $!not_in_context)

Why would these make any difference?

$! means suppress output if null.  There's no output inside a directive 
expression.

I'd expect it'd work the same way as the following

#if ("x" == $!not_in_context)

-Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to