>I am trying to learn Erlang, and like to read code written
>by experienced Erlangers.
I think this is good, and I notice that you've been reading
my code. Hopefully, you will also keep in mind that
experienced programmers do not always set good examples. ;)
>I came across the following things (in xmerl) for which I
>could find no explanation in the documentation:
Apologies for the insufficient documentation.
>What does this mean? Does it automatically export all
>functions contained in the file?
Yes. It's a common way to start out when writing code. It
means that you can easily call all functions in a compiled
module from the shell. This makes it a lot easier to test
Normally, you're supposed to remove the -compile(export_all)
and specifically export only the functions that should be
exported. This is not always done. (:
>There are lots of functions in xmerl with these funny
>names. Does this have any special significance?
These appear in callback modules for exporting XML
structures (e.g. as HTML or XML text). The '#' is "namespace
management", identifying the functions as special control
functions. All other exported functions in such a module are
supposed to signify XML tags (i.e. the function name matches
the XML tag. Since '#text' is not a valid XML tag, there can
be no name clash.
Ulf Wiger, Senior Specialist,
/ / / Architecture & Design of Carrier-Class Software
/ / / Strategic Product & System Management
/ / / Ericsson AB, Connectivity and Control Nodes
> I am trying to learn Erlang, and like to read code
> written by experienced Erlangers.
> I came across the following things (in xmerl) for
> which I could find no explanation in the
> What does this mean? Does it automatically export
> all functions contained in the file?
Yes. I think a more modern approach (at least when you
use makefiles) is to do
erlc +export_all module.erl
and leave the -compile(...) attribute out. (Because
you can change the mass of options once in the
makefile instead of going through each module.)
(or in the top loop, use the clumsier
1> c(module, [export_all]).
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
While out of date this is the most definitive documentation
there exists on the core language.
On Tue, May 27, 2003 at 09:46:47AM +0200, WILLIAMS Dominic wrote:
} I came across the following things (in xmerl) for which I could
} find no explanation in the documentation: