Small poll

Taavi Talvik taavi@REDACTED
Wed Dec 10 22:44:39 CET 2003


On Wed, 10 Dec 2003, Daniel Luna wrote:

> It would be easy (and nice) to add a warning at all points where constant
> propagation detects a possible (probable?) run-time error. I use the word
> possible since I would like the warning in the case
>
>    test(A,B) ->
>      case B of
>        true -> a + 42;
>        _    -> A.
>
> The above function is also a good example of why option 3 is bad. There
> might actually be a reason that the programmer wants to generate a
> run-time error in the case that B is true (I can't think of one, but...).
> Anyway it would be bad to disallow program lines that might actually never
> even be reached.

Still disagree. Erlang specification does not disallow optimizing
compilers, which try to evaluate constant expressions compile time.

Language allready has special construct for throwing exceptions -
throw(...).

Why not force explicit usage of throw() instead of obscure evaluation
side effects?


best regards,
taavi




More information about the erlang-questions mailing list