[Prev][Next][Index][Thread]

generic-arithmetic library



Functional Developer has a generic-arithmetic library that seems to
allow extending the <abstract-integer> type for creating things like
<big-integer> (which is part of FD anyway).

Is it possible to use this for third parties to create extensions of
the <integer> types? I tried following the information in the
documentation but it always tells me that my integer type cannot
derive from <integer> becuse <integer> is sealed. Any pointers? Has
anyone tried it? Or is generic-arithmentic only usable by FD
developers?

Here's how I've defined my library and stuff:

  define library my-lib
    use functional-dylan;
    use generic-arithmetic;

    export my-module;
  end library my-lib;

  define module my-module
    use generic-arithmetic-functional-dylan;
  
    // Add binding exports here.
    export <my-integer>;
  end module my-module;

  define class <my-integer> (<integer>)
  end class <my-integer>;

// Error is:
The superclass <integer> of <my-integer> is defined in another library, and
sealed.

Documentation on generic-arithmetic is at:

http://www.functionalobjects.com/products/doc/core/core_190.htm

Chris.
-- 
http://www.double.co.nz/dylan