From: Kirk Haines Date: 2004-04-03T03:54:08+09:00 Subject: Re: parent of TrueClass, FalseClass, continued On Sat, 3 Apr 2004, Daniel Berger wrote: > You're joking a little, I know, but consider the case of Oracle. > Well, ok, Oracle PL/SQL. In Ruby, nil is false. However, in Oracle > PL/SQL you have a Boolean data type that is either true, false or null > (i.e. unknown). > > Having a Boolean parent class could make object-relational mapping > layer packages, like Kansas, a bit easier (though I admit, I'm > guessing here). It could also be useful in DBI itself, where I could > retrieve data from a column with a NULL value as nil, but which > wouldn't equate to false. From there I can perform tri-state code > logic, ala PL/SQL. > > For example, consider a table with a VARCHAR2(1) column called > "is_deceased" for a list of movie actors and actresses. I could > either have 'Y' or 'N' to indicate true or false. But if there's no > constraint on that column *it could also be NULL*, which is NOT the > same as false. See what I mean? Heh. I skipped a lot of the middle of this thread. Now I am going to have to go back and read it all. I can see for my own use where exactly what you describe would be very useful. I have code right now that deals with precisely what you describe, with a 1 char field that can be 'y' or 'n' or null. I like the way that you think, Mr. Berger. I'm glad I decided to read what you had to say. :) Thanks, Kirk Haines