[m-dev.] diff: module_qual.m import warnings

Peter Schachte pets at cs.mu.oz.au
Mon May 26 10:38:29 AEST 1997


> +		% (The types `int', `float', and `string' are defined
> +		% in mercury_builtin.m, but arguably they ought to be
> +		% defined in int.m, float.m, and string.m, and so if someone
> +		% uses the type `int' in the interface, then we don't warn
> +		% to warn about `import_module int' in the interface.)

It would be seriously nifty if these types were defined in their
respective modules (likewise term and list).  Then these types wouldn't
have to be known by the compiler (except as used in implementing the
compiler).  This would mean I could define my own primitive types (say I
wanted ints to be bignums, or I really wanted to use BCD for compatibility
with COBOL :-), or I wanted to implement strings as cords).  And then, of
course, I would want to have manifest constants of these types appearing
in my source code, which would require the ability to specify the
appropriate translation, performed by the compiler, from the const type to
the appropriate primitive constant.

I think this would be a really good thing.  Are you really contemplating
all this?  Otherwise I think it might be better to forget the pretense
of defining the primitive types in their respective modules and simply
make clear that these are primitive types, the compiler knows all about
them, and users can't monkey with them.


-Peter Schachte      URL:  http://www.cs.mu.oz.au/~pets/
pets at cs.mu.OZ.AU     PGP:  finger pets at 128.250.37.150 for key
    [A computer is] like an Old Testament god, with a lot of rules
    and no mercy.  -- Joseph Campbell




More information about the developers mailing list