[erlang-questions] DRY principle and the syntax inconsistency in fun vs. vanilla functions

Richard O'Keefe <>
Mon May 23 04:00:53 CEST 2011

On 21/05/2011, at 1:57 AM, Michael Turner wrote:

> "... looking at both backward *and* forward compatibility issues (what sort of things might this change prevent us from doing in the future?)"
> I have repeatedly asked people here what this change would break, and in particular how it might compromise backward compatibility. Nobody has answered, so far.

That's principally because people find the proposed change so disgusting
that they don't greatly _care_ whether it is compatible or not;
it's not compatible with *them*.

> Since the change amounts to the compiler silently inserting a function name during parsing at points where some IDE environments already already insert the name literally when you type ";", it's pretty hard to see how there could be a backward compatibility issue.

If you mean "could there be existing code whose meaning would be altered by this
proposal", the answer is "no".
If you mean "could existing tools, including third-party tools, handle this",
the answer is "no, definitely not".
> "Emacs for one would need work since it's syntax highlighting would now be broken."
> It would only be broken for any code that took advantage of the change I suggest.

The thing is that the number of people who took advantage of it is unknown and
and the amount of code that would be affected is unknown and how fast the change
would be adopted is unknown, so somebody using a well trusted tool would NEVER KNOW
WHETHER IT WAS GOING TO BREAK on some file maintained by someone else.

When the new syntax is in support of some new *semantics* that we have a
need for, such as the introduction of 'fun's in the first place, then that
is a price that can be worth paying.

When the new syntax is merely syntactic strychnine, no.

> Which would start out at exactly zero percent of the Erlang code out there. As the supposed "harm" grew, well, somebody would go and modify whatever needed to be modified, to make syntax highlighting work as it does in Emacs already for the analogous syntax in Clojure.
> "If this is so important to you ...."
> It is not that important to me (at the moment.)

Then why are you wasting our time arguing for it?
I've written a working parser for someone else's language in less of my
time than you've wasted.

If you care about it, implement it yourself or pay someone else to.

> However, like anybody else, I hate having my case for change twisted by others, and I hate objections to ideas (mine and others) when the objections don't actually hold water.

I haven't noticed anyone twisting your idea or your case for.
You case is simply that it removes an "inconsistency" which
nobody else seems to perceive as an inconsistency (or if they
do, as one that needs fixing at the *other* end) and reduces
an already trivial amount of typing and makes the language
look more like other languages that many Erlang programmers
have gladly abandoned.

More information about the erlang-questions mailing list