[erlang-questions] New draft of frames proposal (was Re: Frames proposal)

José Valim <>
Thu May 3 12:50:13 CEST 2012


>
> I don't understand this example [p16]
>
>    foo:bar(Ugh),
>
> How is this ambiguous? Are you trying to set the bar element from the
> foo frame? Your next line is unclear.
>

It is ambiguous because:

    { foo:bar(Ugh) }

Could be a tuple with one element which is the result of foo:bar(Ugh) or
a frame with key foo and value bar(Ugh) (according to your proposal).
There is also the "ambiguity" in {}. Is it an empty frame or an empty tuple?

<{ foo: bar(Ugh) }> could work because there would be no ambiguity for
the compiler, but it would be still ambiguous for humans (damn you, humans).
I would shrug if I read a code like <{ foo:bar(Ugh) }> that actually means
<{ foo: bar(Ugh) }>.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120503/d71a5643/attachment.html>


More information about the erlang-questions mailing list