• Daniel Kochmański's avatar
    complex float: add a new types and builtin classes · a0a92dc2
    Daniel Kochmański authored
    What has changed:
    
    - new types si:complex-float, si:complex-single-float,
      si:complex-double-float and si:complex-long-float
    - new builtin classes long-float (for completness) and
      si:complex-float
    - new internal function si:complex-float and si:complex-float-p for
      constructing complex floats (both arguments must be of the same
      float type) and a type predicate
    - printer for new types (right now it conses, see below)
    - a new feature :complex-float
    - a new type is recognized as a type disjoint of complex and real
    
    - cleanup: +built-in-type-list+: remove some redundancy
      For instance instread of saying
        (real (or integer single-float double-float ratio))
      We say
        (real (or integer float ratio))
      etc.
    
    Flaws which will be fixed in upcoming commits:
    
    - complex-float hierarchy is independent of the complex hierarchy
    - ecl_make_complex_float could be replaced by _ecl_make_complex_*float
    - write_complex_float allocates new objects for printing
    - write_complex_float does print unreadable object
    - math dispatchers doesn't recognize the object
    
    Testing things out:
    
    > (si:complex-float 0.0d0 0.0d0)
    ; #<CF(0.0d0 0.0d0)>
    > (si:complex-float 0.0d0 0.0s0)       ; signals type error
    > (+ (si:complex-float 0.0d0 0.0d0) 1) ; signals type error
    
    lisp runtime: make si_complex-float a subtype of a number.
    a0a92dc2
external.h 120 KB