Jamey Cribbs wrote:
> Dave Burt wrote:
>>It does probably demand a prominent warning in the README.
>
> Hey, Dave.  Here's what I have smack dab in the middle of the README:
> ...
> <snip prominent warning>
> ...
> The more I think about this, though, could it be as simple as subclassing 
> NilClass, call it KBNil or whatever?  Then I could override 
> KBNil#method_missing and that wouldn't mess up NilClass.  It would be 
> fairly easy for me to change KirbyBase to return a KBNil for an empty 
> field value instead of nil.

You can subclass NilClass, but it has no allocator, so you'd have to define 
your own, and such an object still wouldn't be considered false in 
conditionals. There is only one nil, and only one false. So there is no 
point in subclassing NilClass.

It seems to me that without changing nil.method_missing, you can't have your 
"select do |rec| rec.a < 0 or rec.b < 0 end". You may be able to (re-)define 
nil.method_missing only for the duration it's required, but that may end up 
be more confusing to users.

Cheers,
Dave