export_to (Was: Re: the OO metaphor)

Thomas Lindgren <>
Fri Dec 1 15:17:55 CET 2000


> There should now be no reason to export a function name that is not
> expected to be called from other modules. (Counterexamples, anyone?)

The only thing I can think of offhand is the rpc library. Perhaps
spawn(Node,Fun) should be used rather than the ordinary rpc library.
Or the rpc library should be retooled to use fun:s instead of
mod/fun/args.

Note that separating -export and -spawn/-apply also guarantees that
-export:ed functions are not spawned or applied unless explicitly so
declared. A tool like xref can then guarantee that nobody is breaking
interfaces by directly calling some module that is intended to be
'local' to an application. Program analyzers and similar tools can be
less conservative as well.

				  Thomas
--
Thomas Lindgren					
Alteon WebSystems

"National differences and antagonism between peoples are daily more and
more vanishing, owing to the development of the bourgeoisie, to
freedom of commerce, to the world market, to uniformity in the mode of
production and in the conditions of life corresponding thereto."
-- Communist Manifesto




More information about the erlang-questions mailing list