[erlang-questions] Parse-transforming !! to a function call

Kenneth Lundin kenneth.lundin@REDACTED
Thu Aug 16 10:03:11 CEST 2007

Sorry, I don't understand why you would ask for a !! operator at all.

If you want to translate A !! B to myspecialrpc(A,B) why not just use
the functioncall directly. I can not see that the !! offers any advantage
more than it perhaps saves you a number of characters per call.

It would on the other hand be a big disadvantage having code that
can't be handled
by the standard Erlang compiler at least if the source is to be distributed.

Joe introduced the bang bang '!!' operator when he developed his ex11
and we did not like it better at that time either.
I think Joe removed the use of !! from ex11 because of the many complaints about
the source not beeing compilable by the standard compiler. So in fact
the unnecessary (for the ex11 problem) introduction of the !! operator
proved to be a
disadvantage for the popularity of ex11.It was not easy enough  to test it.

I am in favour of a VERY VERY RESTRICTIVE approach when it comes to
introduction of non standard language constructs by modifying the
parser or by use of parse transforms since it will result in source
that is hard to understand and use if you don't have the full
knowledge of the language additions and modifications. Parse
transforms can be motivated if used with care and not spread out in
many modules which then are distributed as source.

If there are language improvements or extensions that are of general interest
please write an Erlang Enhancement Proposal (EEP) about it and we will
consider that.

The !! operator as described by Joe is however something that we have
no plans to introduce in the standard language since we think it has
so many problems and questionmarks
and does not offer anything but syntactic sugar. A !! B instead of rpc(A,B) .
Example of problem is that a synchronous rpc can fail in various ways,
for example
if the server does not respond at all. For how long shall the client
wait? If we want a timeout , how should that be specified with that
syntax etc. etc.?

/Kenneth (Erlang/OTP team at Ericsson)

On 8/15/07, Joel Reymont <joelr1@REDACTED> wrote:
> On Aug 15, 2007, at 1:50 PM, Joe Armstrong wrote:
> > Question (to Joel) can't the entire Obj c interface be made dynamic
> > using
> > obj_sendMsg???
> Sure. What is the question, though?
> The reason I asked for !! is to have shorten the code that would
> otherwise need to be written. In absence of !! I would need to add a
> receive loop after each obj ! ....
> --
> http://wagerlabs.com
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list