[erlang-questions] Design strategies for a test suite

John Haugeland stonecypher@REDACTED
Fri May 16 22:45:27 CEST 2008


Looks like I managed to send this to Paul privately instead of the list as
intended.  Gee, I love sucking at the internet.


> %% API
> -ifdef(NDEBUG).
> -export([foo/0]).
> -else.
> -compile([export_all, debug_info]).
> -endif.
>

I'm not really sure how I feel about the export prototype list changing on
terms of a macro define.  The thing that gives me pause is the importance of
a compile in Erlang's module system: just compiling something has some
pretty major impact on its use in a live system.  Still, it's not any worse
than the things I'd already come up with.

I'm starting to think this Selective Export thing might be what I want.  I
don't see much talk of how it's done exactly, and when I googled I got stuff
from Eiffel and Haskell.  That said, what Eiffel and Haskell have seem to be
what I want.  I went digging through the eeps looking for a discussion of
what's intended, but didn't find one.  I'm kind of a noob, here; where
should I be looking to see what's planned?

Am I right in believing we'd be seeing something like this?

-export([foo/0, foo/1]).
-export_to(some_module, [bar/0]).

That sort of thing seems extremely desirable to me.  One of the biggest
problems I'm having with Erlang right now is a way to govern display at the
code level of facilities.  I'm very much a C++ mindset person, and I'm very
much in desire of some way to seal off access to a lot of stuff that's just
sitting out exposed right now.

Selective export would allow me to do the kind of closed-access thing I'm
used to from friend declarations, and if it worked with one's own module,
it'd provide me a way to make spawnable functions internal only (something I
really, really badly want) just by naming the module in its own export
clause.

-module(protected_example).
-export_to(protected_example, [privateish_spawnable/0]).    % want badly

So, pardon me please for speaking up at what's probably late in the game,
but where can I go to read about the current mindset for selective export,
and whether it's expected as a language feature?  (It would be tremendously
useful.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080516/3c1611e9/attachment.htm>


More information about the erlang-questions mailing list