closures after all?
Neal Gafter
neal at gafter.com
Fri Nov 20 15:02:02 PST 2009
On Fri, Nov 20, 2009 at 2:50 PM, Lawrence Kesteloot <lk at teamten.com> wrote:
> If I understand pattern-based specification, it's basically
> compile-time duck typing (e.g., C++ templates). One advantage of
> interface-based specifications is that there's a javadoc I can read to
> learn about the contract.
>
A pattern-based specification can still be used with an interface like
AutoCloseable. Even if interface-based, its specification can't really say
much about a contract.
I have a similar objection to closures: it encourages variables and
> parameters that are anonymous function signatures with no javadoc to
> help me learn about the contract. (CICE is exempt from this
> objection.)
>
Variables don't normally have contracts. Parameters, on the other hand,
usually have their contracts specified in the method. In the cases where
you would use a function type, there isn't much for the javadoc to day.
Just like primitive types, which also don't have contracts.
More information about the coin-dev
mailing list