From: Eric Hodel Date: 2011-10-01T16:48:52+09:00 Subject: [ruby-core:39807] Re: [Ruby 1.9 - Feature #5372][Open] Promote blank? to a core protocol On Sep 27, 2011, at 6:52 PM, Alex Young wrote: > Think of it like the Null Object pattern in reverse. The Null Object is described on the C2 wiki and its related pages: http://c2.com/cgi/wiki?NullObject It seems to be better than implementing Object#empty? Can you show me a description of the opposite? > Because the core API commonly returns nil in error cases.. Can you show some examples? I don't seem to write nil checks very often when using core methods, but maybe I am forgetting. I would rather improve the API to have fewer nil return values than add #empty? everywhere. > case thingy > when Blank > # catch-all > # other cases > end What about: case thingy # other cases else # catch-all end