Using -spec for callbacks when defining behaviours

Steve Davis <>
Sat Mar 20 11:26:23 CET 2010


Hi Mikael,

A serious omission from "interfaces" that simply enforce type is that
they totally ignore the concept of state, and are therefore
necessarily incomplete.
Contracts (as illustrated by UBF) are definitely more satisfactory...
If I am understanding the problem correctly (and it's more than
possible I am not), you'd generally apply contracts to protocols (i.e.
to the messages exchanged), not to the specific arguments presented to
the API functions used for any protocol implementation.

regs,
/s

On Mar 19, 3:59 am, Mikael Karlsson <> wrote:
>
> Erlang is very efficient to implement applications in and as long as
> you roll your own stuff or are within a tight group I think your
> points apply, but I would like to argue that for building large
> community based infrastructure it is very important to be able to have
> useful interface specifications/contracts.
>


More information about the erlang-questions mailing list