Proposed change to libraries
Kostis Sagonas
kostis@REDACTED
Mon Feb 14 18:38:35 CET 2005
Dominic Williams wrote:
> Erlang is not a type-safe language, so it seems to me that the
> libraries are consistent with the documentation if they work as
> advertized, for advertized types. There is no implicit suggestion
> that they should refuse to work on other types.
Oh, but more often than not they do! Try:
lists:map(gazonk, [1]).
and you will get an exception.
> I see guards as a pattern matching tool (i.e. to provide a separate
> clause for separate types), not as a type checking tool. I practice
> test-driven development, so I am not interested in the compiler
> doing any type checking. What matters to me, as a programmer, is that
> Erlang allows me to write simple, economical code where I don't need
> to explicitly declare types or guarantee type safety.
Let me assure you that whatever we do would not force you to change
your favourite working habbits. Nobody will _require_ you to declare
types. But you will not be able to write calls such as:
lists:map(gazonk, []).
and expect them not to throw an exception at *runtime*.
> What the motivation is for having stricter type checking in Erlang?
So that people who choose to do this, can.
Best,
Kostis
More information about the erlang-questions
mailing list