Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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
flaw:
it is hard to tell what a module depends on by inspection ( you have too
look
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
module.
(Unlike 'open', a such a statement doesn't make the symbols defined in
the
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]
mailto:maxs@in.ot.com.au      -- at work
mailto:skaller@maxtal.com.au  -- at home