[mercury-users] socket support in io

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Oct 4 13:15:40 AEST 1999


On 03-Oct-1999, Juergen Stuber <juergen at mpi-sb.mpg.de> wrote:
> Fergus Henderson <fjh at cs.mu.OZ.AU> writes:
> > 
> > 	- Move the RTTI stuff from std_util.m into a separate module
> 
> I think it would be a good idea to split std_util into separate
> modules, one for each type, even if these get rather small.
> Often I need only one of them, and it is easier to always use
> the name of the type also for the module than to remember they
> are in std_util.

For `unit' and `maybe_error', having a separate module containing only
the type definition seems a bit like overkill to me.  But I agree there
is a good case for putting `univ', `pair' and `maybe' in separate modules.
(The maybe_error/0 and maybe_error/1 types could go in the `maybe' module.)

> Also I would like to see the builtin types `character', `int',
> `float', and `string' treated like any other type; they should be
> qualified by some module, preferably the corresponding module of the
> standard library.  This would make things more consistent and allow
> to reuse their names (say for unicode__character).

The original rationale for treating the builtin types specially was
because the constants of those types are treated specially.  It would
be somewhat inconsistent to allow the literals `42', `"foo"', to be
used without importing any module, but not to allow their types to be
used without importing any module.

But the builtin types do indeed have module qualifiers -- they can be
referred to as `builtin__int', `builtin__float', `builtin__string', and
`builtin__character'.  The only difference is that the module `builtin'
is automatically imported into every module.  You can reuse the names,
so long as you use module qualifiers to avoid ambiguity -- that is, you
can define a `unicode__character' type, you just can't refer to it as
`character'.

Perhaps you would like something analagous to Haskell's
`import qualified Prelude', i.e. a way to prevent the automatic
import of the module `builtin'?

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list