I am working to override a sortCompareFunction on a column, and in
doins so, I am handling my specific case and when applicable, just
passing to ObjectUtil.compare() so as not to reimplement all of the
simple type checking.

One case that I have is when the comparison objects are Booleans.
Looking at the source, it looks like it takes the Booleans and
performs a "numericCompare" on them.  Makes sense to me.. assuming
that true maps to 1 and false maps to 0.  However, strangely enough,
they BOTH map to 0.

I know I can handle this myself in my own code, but doesn't this seem
like a bug?

Very simply, execute this:
<code>
    var a:Boolean = true;
    var b:Boolean = false;
    var aNum:Number = a as Number;
    var bNum:Number = b as Number;
    Alert.show("Boolean: " + a + ", " + b + "; Number: " + aNum + ", "
+ bNum);
    //var comparison:int = ObjectUtil.compare(a, b);
    // the result here is always 0;
</code>

What would you expect the result to be?  Personally, I would have
expected:  Boolean: true, false;  Number: 1, 0

Perhaps I am just getting loopy/tired in figuring this out.
Thanks for any feedback.






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to