Calling internal functions - foo::bar() ?
Vlad Dumitrescu
vlad_dumitrescu@REDACTED
Mon Mar 7 14:09:36 CET 2005
Hi,
From: "Thomas Lindgren" <thomasl_erlang@REDACTED>
> Note that you can handle this by a simple high-level
> transformation.
That's a nice idea.
However, I am not convinced that exposing internal functions is a good idea. If
it is a good idea, then why not remove -export() completely, and use any
optimizations to all intra-module calls?
Like someone said before, having an accessible function will make people use it
even if it shouldn't be used directly, creating a basic setup for Maintenance
Hell (TM). Encapsulation is a good principle for a reason. And also internal
functions need not be documented ;-)
Yes, it was said that only the shell should be able to access those, but this
can't be guaranteed (or if it can it would cost too much).
My personal feeling is that testing internal functionality should be done by
using (exported) test functions. This has its own drawbacks of course, but it
feels better on the whole.
best regards,
Vlad
More information about the erlang-questions
mailing list