[erlang-questions] about fun vs. functions schisofrenia

Matej Kosik <>
Fri Jan 11 11:40:53 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Friends,

What do you think about artificial discrimination between "funs" and functions in Erlang? I came
from a language (Pict) where these could be used interchangably. In Erlang, these things cannot be
used interchangably and this leads to fun vs. function schisofrenia. You have to define separate
functions that requre "funs" and a separate set of functions that require funs. This breaks the code
at every corner (or export everything but this is nonsense).

How should I call

	PrintedEntities = rpc:pmap( {?MODULE, print_entity},
                                    [AttributeNames, ExportFunctions, State], SortedEntities
                                  ),

without being forced to export the `print_entity/4' function? I would really like to keep it "private".

And, how could I perform (it must be done in parallel) a similar operation with "funs"?
- --
Matej Kosik
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHh0e1L+CaXfJI/hgRAp3gAJ4w8f+WJZi/e426YaL/NjT4RmMUHwCgslCp
4WuYMGLEH7cnv4E+/a/jd+o=
=EdRN
-----END PGP SIGNATURE-----



More information about the erlang-questions mailing list