This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: SCM_VALIDATE_...



Mikael Djurfeldt <mdj@mdj.nada.kth.se> writes:

> Mikael Djurfeldt <mdj@mdj.nada.kth.se> writes:
> 
> > They are, and, in my view, should continue to be identical in the
> > sense that the representations are the leaves of the numeric
> > hierarchy.
> 
> What I really mean is that we should follow this rule:
> 
> The only case where *a* value type of an object can differ from *the*
> representation type is when the class representing the representation
> (ehrm..) is a proper subclass of the class representing the value
> type.

If I understand you, this makes it difficult to introduce new
representations which have more expressive power than an existing
representation.  If you have an existing class hierarchy like:

<number>
  <complex>
    <real>
      <rational>
        <integer>
          <bignum>
            <fixnum>

and you want to introduce a new type like (say) <algebraic>, which can
represent things like (sqrt 2) exactly, it must be a subclass of
<real>, but a superclass of <rational>.  We can't add that to the
system without modifying the definition of <rational>.  

So it looks to me like your suggestion leads to a rigid numeric tower.
I thought one of the advantages of OOPS was that ordinary code could
seamlessly extend the numeric tower.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]