Tue Dec 16 10:32:39 CET 2003
Robert Virding wrote:
> 2. As Dr. Joe (again congratulations Joe) points out "a+42" IS LEGAL ERLANG! Sorry for shouting but the point must be stressed. How can any one seriously suggest that the compiler disallow legal code? You are actually changing the semantics of the language when you do this. Are you aware of this fact?
i did not know ''a+42'' was legal. i thought it generated an error.
> Finally one definite reason not to outlaw a+42 is that it is one of my standard ways of generating an error in code, being much shorter to write than exit(some_bogus_exit_value).
i think that a+42, with a comment stating that this is indeed intended
to cause an error, and an explanation why you want an error here, is
probably longer than erlang:exit(why_you_want_an_error).
presumably you do not suggest putting a+42, without any explanation,
into the source?
> P.S. If things like this are added to the compiler then it is time for an alternate compiler.
i think this is a very good suggestion. if it frightens anybody i would
like to mention that it was egcs that became gcc-2.
More information about the erlang-questions