--90e6ba6e86725e86520498321a1b
Content-Type: text/plain; charset=ISO-8859-1

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!!

  -hex

p.s. i'll post a link to the source once it's in a form that's not
embarrasing!  :P


On Fri, Dec 24, 2010 at 5:40 PM, Colin Bartlett <colinb2r / googlemail.com>wrote:

> On Fri, Dec 24, 2010 at 3:45 AM, serialhex <serialhex / gmail.com> wrote:
>
> > Alright, i'm trying to do three things at once, and I'm almost
> succeeding.
> >  The first thing is learn Ruby, the second thing is learn Surreal
> Numbers,
> > and the third is to make a Ruby class for Surreal numbers.  :P  My
> problem
> > is this:  part of the definition of a surreal number is pretty much a
> > comparison with nil.  So how would one go about this?  Should I write a
> <> > and mixin Comparable? What else should I include to make this easier??
>  Any
> > help & suggestions are most welcome!!
> >
>
> A possibly unhelpful suggestion about nil <y and y <nil: does the nil
> for Surreal *have* to be the Ruby nil of NilClass?
>
> I think it could be (as you say, write Nil#<and mixin Comparable) and I
> guess that it's unlikely that a SurrealNumbers class would be used with
> anything else?? (But you can never be sure: another of my lecturers (see
> Semi-OT below) was Ian Stewart, and in one of his 1990s (sort of) popular
> books on modern mathematics he says non-standard arithmetic has been used
> to
> devise better ways of representing images using pixels (or something like
> that): basically work out the theory using "finite" "infinite" integers,
> then use the results to make a practical algorithm by changing a "finite"
> "infinite" integer to a large finite integer.)
>
> So if you wanted to avoid possible clashes with other code which expects
> (nil <other) to raise an exception you could set up
>
> class Surreal::SurrealNil
>  # define appropriate methods
> end
> Surreal::Nil  urreal::SurrealNil.new
> Nil  urreal::Nil  # maybe
>
> You can do:
> class Surreal::SurrealNil < NilClass
> but then there isn't Surreal::SurrealNil.new, presumably because there
> isn't
> NilClass.new
>
> I'd be interested to see what you come up with, because periodically I try
> to really understand NonStandard Analysis, and the NonStandard Reals are a
> subset of the Surreals.
>
>
> *** Semi-OT: I followed up some links from your links, and found a name I
> recognized as the lecturer who gave my first (or at least one of my first)
> lectures in mathematics at the University of Warwick in October 1973, a one
> term course on the Foundations of Mathematics. (Basically set theory using
> Paul Halmos's Naive Set Theory.) I knew he became very interested in
> mathematical education some time after I'd graduated, but I didn't know
> that
> he was also interested in "intuitive" concepts of infinity. Following up
> links and trying to find out more about David O Tall's "super-real" numbers
> I found:
> http://www.jonhoyle.com/MAAseaway/Infinitesimals.html (section 3.2)
> A less ambitious but much more accessible approach to defining
> infinitesimals is one by David Tall from the University of Warwick. His
> motivation was to create a system which was more intuitive for students and
> to make Calculus concepts easier to grasp. The simplicity of his approach
> is
> very appealing, as it quickly gets to the use of infinitesimals without the
> large construction found *R's construction. ...
> http://www.warwick.ac.uk/staff/David.Tall/downloads.html
> http://www.warwick.ac.uk/staff/David.Tall/themes/limits-infinity.html
> and in particular this delightful conversation about infinity between David
> Tall and his seven year old son:
> http://www.warwick.ac.uk/staff/David.Tall/pdfs/dot2001l-childs-infinity.pdf
>

--90e6ba6e86725e86520498321a1b--