From: Jason Roelofs Date: 2009-01-14T22:55:30+09:00 Subject: Re: Why do true and false have separate classes On Wed, Jan 14, 2009 at 8:26 AM, Ruby Rabbit wrote: > This has puzzled me a bit. I googled and came up with responses like -- > in any case we use respond_to? for duck typing. > > I am writing a program in which some classes behave differently > depending on the data in various columns. Typically, this means > displaying and editing of cells. So true and false are boolean and are > displayed and edited as checkboxes. > > Having 2 separate classes really complicated things since i don't want > to define 2 separate renderers and editors for true and false. > > Just wondered what the thought behind this was? > -- > Posted via http://www.ruby-forum.com/. > > It's only the core philosophy of Ruby: You have objects send messages to those objects. If there weren't a TrueClass and FalseClass, what else would true and false be? Jason