
ToDo:
  - quake templates, generic modules
     - generic parameter should be ordered in increasing complexity
        this conforms to libm3
        but unfortunately I started with the reverse order
     - reduce number parameters to template procedures,
       build final module names within that procedures
     - define conventions for prototypes of such template procedures
  - exceptions
     - The number of different exceptions should be kept at a minimum,
       because every procedure has to declare all exceptions
       that the called procedures may throw.
       But the exceptions should be meaningful.
       The current solution with an enumeration type
       for Err is not expressive enough.
       What about objects?
       What about List of objects?
     - overflow check (at least in integer modules)
  - separate the whole libraries into pieces that are usually used together,
       that are three libraries: realarithmetic, longrealarithmetic, extendedarithmetic

  - distinguishing between e.g. VectorBasic and VectorFast
    makes things complicated,
    I think the implementation method should not appear in the module name.
    Instead use modules following this scheme:
      Vector - basic vector operations on references to vectors,
               vectors may be even opaque and branded,
               the routines are all inlined and
               forward the arguments to VectorRep routines
      VectorRep - basic vector operations on READONLY ARRAYs,
                  the procedures are constants imported from either
                  VectorBasic or VectorFast
      VectorBasic - operations on READONLY ARRAYs using Add, Mul, etc. from the entry type
      VectorFast - operations on READONLY ARRAYs using +, *, etc. of the entry type
     - making Vector.T an opaque type disallows x^, NUMBER(x^) and x[i],
       you must either import VectorRep (more effort) or
       write accessor functions (inefficient without INLINE)
  - Hash routines
  - ODE by Simon Hood
  - object oriented interface
     - In principle it is possible to create a general mathematical object class.
       A good interpretation of such an object is "expression" and
       it may be a sum, a product, a vector, a polynomial etc.
       "Expression" is the main class and "sum" etc. are sub classes.
       The sub classes could reuse the static types and their procedures.
       The advantages are that there is no need to instantiate generic modules
       and that repeated application is possible,
       as needed for example for continued fractions.
       The disadvantage is clearly the reduced performance
       because of more dynamic memory allocation and
       variable jumps to methods (dynamic linking).
     - Both the object oriented and the static typed interface
       could coexist kindly.
     - We have to ask where to stop such development
       because we definitely don't need a new computer algebra system.



people:
Harry George	http://www.seanet.com/~hgg9140/math/index.html
Warren D. Smith	http://www.neci.nec.com/homepages/wds/myresume.html
Thomas Brupbacher	http://research.compaq.com/SRC/modula-3/html/acks.html
Simon Hood	e-mail?

-------------------------------------

questions:

PROCEDURE Uniform(self:RandomGen;
                  min:REAL64:=0.0D0;  (*from min*)
                  max:REAL64:=1.0D0   (*up to but not including max*)
                  ):REAL64            (*return uniform deviate*)
                  (* RAISES{xUtils.Error} *)
                  =

METHODS
    uniform(min:REAL64:=Min;  (*from min*)
            max:REAL64:=Max   (*to max*)
              ):REAL64
              (*RAISES{xUtils.Error}*);        (*return uniform deviate*)

match, but if the RAISES statement is also given the compiler seems to see a difference in both declarations and thus outputs "procedure redefined (Uniform)"

may be that xUtils are not imported in one of these modules
 - the compiler complains about type incompabilities before knowing of the identifiers

---------------

The "incompatible types" compiler message may be more expressive:
  incompatible types (arg(2): expected type T0, got type T1)

---------------

It would be of great help, if the compiler tells me with which (implicitly given) declaration the new one conflicts and where it is was done, e.g.

"Rand.m3", line 123: procedure redefined (Uniform), in
"Rand.i3", line 234: defined as Uniform (blabla : TEXT)
exception list differs

When IMPORT is used after the first declaration,
the compiler should give a more precise error diagnostic.

Modula-3 definition says: MOD (x, y: Float) : Float
but cm3 expects: infix    MOD (x, y: Float) : Float
(Modula-3 definition is a bit unclear there,
because the operator name MOD is repeated,
but the attribute 'infix' is not
in opposition to other operators)

---------------

quake should complain about doubly given 'library' statement

---------------

TYPE
  RowBody    = ARRAY OF B.T;
  MatrixBody = ARRAY OF RowBody;

VAR
  mat : REF ARRAY OF ARRAY OF B.T;

BEGIN
  mat^ := MatrixBody{RowBody{B.Zero,B.One},RowBody{B.One,B.One}};


This let the compiler abort without a meaningful error report.
It seems to be a problem with the unknown inner dimension.

---------------

***
*** runtime error:
***    Exception "Convert.Failed" not in RAISES list
***    file "../src/fmtlex/Fmt.m3", line 292
***

this error is raised if one writes '%' instead of '%s'
in the format string of Fmt.FN

---------------

There should be a warning if a variable is passed to a READONLY and a VAR parameter at the same call.

---------------

TYPE
  T = BITS 32 FOR [-16_80000000..16_7FFFFFFF];

"../src/na/integer/Integer32.i3", line 10: subrange lower bound is not constant
1 error encountered

seems that the lower bound is too small

---------------

"../LINUXLIBC6/RealInterpolation.m3 => ../src/na/nonlinear/Interpolation.mg", line 191: SUBARRAY: first argument must be an array


***
*** runtime error:
***    <*ASSERT*> failed.
***    file "../src/exprs/Expr.m3", line 337
***

in m3-sys/m3front/src/exprs/Expr.m3:
PROCEDURE NotAddressable (<*UNUSED*> t: T) =
  BEGIN
    <*ASSERT FALSE*>
  END NotAddressable;

---------------

Design question:

Is it better to create a pair interface,module for every set of functions for the same datatype
or is it better to create one interface and multiple modules that export to this interface.
The reason is that I don't want to mix low level computation routines
with high level formatting routines.

---------------

Modules with computations of a different naming scheme:
m3core/fingerprint/Poly: Sum, Product, TimesX, Power
m3core/word/Word: Plus, Minus, Times, Divide
Point: Add, Sub, Mul, Div

---------------

Conventions for names of Array and Reference types?

List of conventions for names for modules, types, variables, constants, record entries, exceptions, order of procedure parameters

---------------

How can I access the name of a module that another module imports?
This is especially useful if you want to find out, with which module
a generic module was instantiated.

---------------

Eps should be defined in Real.i3, LongReal.i3, Extended.i3,
or Scaleb gets the privilege to generate constants
ExtendedType.[im]3 -> main repository

---------------

/usr/local/cm3/doc/reference/objects.html
<A HREF="opaques.html#idx.129">opaque type</A>,

---------------

build_generic_intf
build_generic_impl
 aren't described in cm3/doc/help/cm3/

---------------

If an exception occurs twice in a RAISES list the compiler says
"warning: exception is never raised: PLPlot.SizeMismatch"

