Small poll

Thomas Lindgren thomasl_erlang@REDACTED
Wed Dec 10 22:31:38 CET 2003


--- Luke Gorrie <luke@REDACTED> wrote:
> Kostis Sagonas <kostis@REDACTED> writes:
> 
> > I was wondering whether the Erlang user community
> would care
> > to comment on the following:
> > 
> > In a function like:
> > 
> > 	test(A) ->
> > 	    a + 42.
> > 
> > which is either crap (arguably) or a typo (A vs
> a), how many
> > Erlang users:
> > 
> >  1. Are content with the current situation where
> the compiler
> > 	happily compiles this program
> >  2. Would like to see a warning, but a .beam file
> generated
> > 	nevetheless
> >  3. Would prefer if the compiler in R10 refused to
> compile it

I prefer (2) with an OPTIONAL warning, and otherwise
concur with Luke. CMUCL:s user interaction is the most
sophisticated I know of, so building on efficiency
notes etc. sounds like a good idea. (As a principle,
it is a bad idea to leave the programmer guessing
about what sort of tweaks should be made for good
performance.)

However, there are some problems. First, it should be
noted that Common Lisp has a much richer type system
than Erlang. Expressing that something is a fixnum or
a specialized sort of tuple is tedious in Erlang. 

Second, the various type annotations one might want to
make are probably easier and more elegantly done with
macros in CL than in Erlang. Some easy way of
communicating those to the compiler is probably
needed.

In short, the compiler-user interaction is worth some
careful thinking.

Best,
Thomas

PS. As regards warnings in general, I would like two
more options:

- Warn when a variable occurrence is matched rather
than bound. This has turned out to be a bug more often
than I would have liked.

- Warn about unknown compiler options (currently just ignored)

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/



More information about the erlang-questions mailing list