Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
convenient features
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-06-30 (15:33)
From: Max Skaller <maxs@i...>
Subject: Re: convenient features
Daniel de Rauglaudre wrote:

> If Ocaml chooses for you, it can be a problem if you want to make side
> effects in some order while executing these modules.

Then you could either:

	1) add a dummy dependency in, to force the ordering

This is a hack, but so is using side effects to initialise modules :-)

	2) think about a language feature to replace the dummy
dependency. In Python, you have to explicitly import a module
before you can use it. In C, you have to explicitly #include a file
before you can use the resources it represents the interface for.
In ocaml, the lack of such a requirement could be viewed as a design
it is hard to tell what a module depends on by inspection ( you have too
at every line of code carefully to find which names are module names).

An 'import' or 'use' statement might also allow a local name for the
(Unlike 'open', a such a statement doesn't make the symbols defined in
module available unqualified).

A possible extension: to instantiate a functor (i.e. use an instance
of a functor module).

John (Max) Skaller at OTT [Open Telecommications Ltd]      -- at work  -- at home