From: Robert Klemme Date: 2010-12-27T19:46:59+09:00 Subject: Re: Numeric comparison with nil - Math masochists only!! On Sat, Dec 25, 2010 at 2:34 AM, serialhex wrote: > Colin, your amazing insight has led me to programming greatness!!! > > ...ok, mabye not so much, but i have (mostly) solved the problem using the > Delegate class, heres the relevant code: > > ## > require 'delegate' > > class SurrealNil < DelegateClass(NilClass) >  include Comparable >  def <=> other >    return -1 >  end >  def initialize >    super nil >  end > end > ## > > it returns -1 all the time so no matter what you compare it against it's > less than that (i mean, sereously, an empty set is WAAAAYYYYYYY less than > neg infinity, cause with neg infinity you still have SOMETHING right?) > > so while the rest of the project is FAR from finished, at least this part is > completed.  thanks for the help!! If you need additional input I have written about numeric classes in our blog http://blog.rubybestpractices.com/posts/rklemme/019-Complete_Numeric_Class.html Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/