[stringtemplate-interest] null vs missing vs empty vs nonexistent
Zenaan Harkness
zen at freedbms.net
Thu Oct 15 20:04:02 PDT 2009
(Again, to all, please make an effort to bottom-post, where at all
possible, if no objections to doing so. Thanks.)
On Thu, Oct 15, 2009 at 02:25:43PM -0700, Graham Wideman wrote:
>
> At 10/15/2009 01:56 PM, Terence Parr wrote:
> >was thinking about that but figured it'd confuse. we have <if(!foo)foo
> >is missing<endif> anyway.
>
> ...though ! appears to have two problems for detecting the missing case: it doesn't distinguish between FALSE and null (and missing if missing is legal here), and docs I think probably aren't clear on whether the missing case is legal and treated like null, or should cause error.
>
> Generally I think if you establish missing as a concept distinct from null, then to minimizing confusion means that everywhere those concepts arise they should get distinct treatment (eg: parallel options in render).
Graham this is an excellent, and I must add, very important point.
There have been >1 times when I have been frustrated with the concept
limitation and ambiguity/ overloading, of boolean value (true/false) as
compared with null and/ or missing.
In reality, we-the-template-authors have to handle (in some way or
other) the three concepts:
- boolean
- null
- missing attribute
Should all three concepts be compressed into boolean?
Should they be separate?
Notwithstanding if separate boolean, should null and missing be separate
or combined?
Again, I have to strongly agree here with Graham - if the concepts are
treated separately somewhere, they ought to be, if possible, treated as
separate concepts _everywhere_.
> This of course runs into trouble applying boolean operators to what is now becoming a 4-value situation: true-val/false-val/null/missing --> true/false/maybe-error.
>
> :-(
>
> No time as good as a new version to take a stand though!
ACK!
> (BTW, are you really saying there are also empty and nonexistant cases?)
>
> Graham
>
>
> >Ter
> >On Oct 15, 2009, at 1:53 PM, Graham Wideman wrote:
> >
> >> If you're worried about whether the missing case should or should
> >> not be treated like null, might you consider a missing="something"
> >> option to parallel null="something"?
If the concepts are treated distinctly somewhere, consistency dictates,
once again, that the concepts are treated distinctly everywhere. So yes,
null="blah" and empty="foo" (or non="foo" or whatever).
Similarly, the conditionals:
- if (for true/false)
- ifnull
- ifempty
- etc for other parts of ST lang
Consistency of concept treatment is essential!
> >> At 10/15/2009 12:25 PM, you wrote:
> >>> Ok, we have an important choice to make. Thanks to Bill Venners were
> >>> bringing this up last year. It's important enough and long enough
> >>> that
> >>> I added to my blog:
> >>>
> >>> http://tinyurl.com/parrt-on-null-attributes
> >>>
> >>> Here is my summary from the bottom of the page:
> >>
> >> _______________________________________________
> >> stringtemplate-interest mailing list
> >> stringtemplate-interest at antlr.org
> >> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
--
Homepage: www.SoulSound.net -- Free Australia: www.UPMART.org
Please respect the confidentiality of this email as sensibly warranted.
More information about the stringtemplate-interest
mailing list