Calling internal functions - foo::bar() ?

Thomas Lindgren thomasl_erlang@REDACTED
Mon Mar 7 15:01:53 CET 2005


--- Vlad Dumitrescu <vlad_dumitrescu@REDACTED>
wrote:
> Hi,
> 
> From: "Thomas Lindgren" <thomasl_erlang@REDACTED>
> > Note that you can handle this by a simple
> high-level
> > transformation.
> 
> That's a nice idea.

I regret I didn't think of it first :-)

> 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?

Well, the previous optimization only shows there is no
real need to forbid :: on grounds of performance.
Introducing :: may, as you say, still be a bad idea.

I find myself wavering on that issue: on one hand, you
may be right in that it's hell on maintenance; on the
other hand, I still find it preferrable to
-compile(export_all).

xref and similar tools could detect anomalies either
way, either by looking for :: or by disregarding
export_all and warning about calls that do not use
explicitly exported functions.

> 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.

Well, that's another reasonable argument for avoiding
::, at least as part of the language (rather than as a
shell hack).

(Finally, on the gripping hand, there might be yet
another, superior approach to the problem somewhere.)

Best,
Thomas



	
		
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/



More information about the erlang-questions mailing list