[MOBY-l] Boolean object
Paul Gordon
gordonp at ucalgary.ca
Thu Mar 3 19:31:48 UTC 2005
Wikipedia to the rescue! :-)
http://en.wikipedia.org/wiki/Canonical#Computer_science
In CS, "canonical" is more like "best-practice convention" than
canonical in the religous or mathematical sense. "true" and "false" are
"best-practice" lexical representations for booleans. Of course, since
MOBY's lexical and semantic rules stand alone (though they could be
*expressed* in XMLSchema, DTDs, Relax-NG, etc.), there is no requirement
to allow 0 and 1 as valid values. I realize that I'm being pedantic,
but I think that giving people choices on how to express such a simple
notion brings unneeded (albeit minor) complexity to the API.
My $0.02 :-)
P.S. One advatange of 0/1 is that it is not specific to English. But
given that the entire MOBY API is in English anyway...
Gary Schiltz wrote:
> I think I'm in Paul's camp here, although I notice that the W3C
> recommendation on XML Schema allows true, false, 1, and 0 as valid
> lexical values for booleans (see www.w3.org/TR/xmlschema-2/#boolean).
> But then, they say that the "canonical representation" for booleans is
> true and false. I am still confused as to the difference between the
> lexical and canonical representations.
>
> // Gary
>
> Paul Gordon wrote:
>
>> May I suggest that the boolean primitive have the one of the values
>> "true" or "false", not "0" or "1". This would alleve any confusion
>> with integers, is more human readable, and is valid since "0" and "1"
>> in Boolean logic are only arbitrary symbols in a lattice system (i.e.
>> it is the union, intersection and negation functions that define the
>> logic, not the symbols used).
>
>
> _______________________________________________
> moby-l mailing list
> moby-l at biomoby.org
> http://biomoby.org/mailman/listinfo/moby-l
>
More information about the moby-l
mailing list