chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] What is the purpose of module interfaces?


From: Felix
Subject: Re: [Chicken-users] What is the purpose of module interfaces?
Date: Wed, 17 Oct 2012 05:27:14 -0400 (EDT)

> I am trying to understand the usage of module interfaces (i.e.
> DEFINE-INTERFACE and (interface: INTERFACE-NAME) in export lists). At first
> glance they seemed like a good thing--but having experimented a bit with
> them, I'm not sure I really see the point. As far as I can tell, all that
> interfaces do is provide a convenient way to enable or disable groups of
> exported definitions at compile time (i.e., the time when the exporting
> module is compiled). If so, it seems like a feature that adds significant
> complexity in return for a very marginal benefit. But perhaps I'm missing
> something? I would be interested to see an example of a practical
> application for these interfaces.

The complexity is not what I'd call significant - just a
straightforward (and non-exportable) naming of export lists. Actually,
this is rather pathetic and could even be removed without too many
people complaining. But if you write functors and lots of
functor-instantiations, it can be convenient not to name each and
every export at each instantiation. See also "tests/functor-tests.scm"
in the git repository (or the source tarball): if the interface of
"QUEUE" would be large, repeating it in every variant would become
tiresome and error-prone.

I hope this clears things up a bit.


cheers,
felix



reply via email to

[Prev in Thread] Current Thread [Next in Thread]