[erlang-questions] 答复: Is it a compiler bug?

Robert Virding rvirding@REDACTED
Sat Apr 22 21:23:50 CEST 2017


There is no *need* of it as such it just what the syntax allows. I think we
should require the parentheses again and make the current usage a syntax
error.

Robert


On 14 April 2017 at 04:24, 赵 汉 <botanyzh@REDACTED> wrote:

> I still don’t get the sense , What is the need for such weird appending
> use?
>
>
>
> 发送自 Windows 10 版邮件 <https://go.microsoft.com/fwlink/?LinkId=550986>应用
>
>
>
> *发件人: *Robert Virding <rvirding@REDACTED>
> *发送时间: *2017年4月14日 8:15
> *收件人: *Dmytro Lytovchenko <dmytro.lytovchenko@REDACTED>
> *抄送: *Erlang Questions <erlang-questions@REDACTED>; Stanislaw Klekot
> <dozzie@REDACTED>
> *主题: *Re: [erlang-questions] Is it a compiler bug?
>
>
>
> IIRC originally parentheses were required around the first was required
> which would have caught this case. The requirement was then removed, but I
> don't know why. Perhaps to save the extra 2 chars. :-)
>
>
>
> On 13 April 2017 at 16:43, Dmytro Lytovchenko <
> dmytro.lytovchenko@REDACTED> wrote:
>
> I can see how enforcing parentheses in map()map() syntax can be useful.
>
> A compiler warning would be awesome here. Also this is a nice thing for
> Elvis style checker to do, but when it comes to running Elvis, your program
> should already be correct — so that is too late.
>
>
>
> In variable()map() syntax there is no confusion so that is fine.
>
>
>
> 2017-04-13 16:14 GMT+02:00 Jesper Louis Andersen <
> jesper.louis.andersen@REDACTED>:
>
> No, it is not stupidity in any way.
>
>
>
> People hit this now and again. It makes sense to solve the problem this
> way. I remember we considered the alternative, which is to reject the
> notion, but this requires some special-handling in the compiler and isn't
> clear-cut either.
>
>
>
> In short, regarding this as an invalid expression is to a certain extent
> possible, and certainly desirable. But we run into subtle problems when we
> want to reject it too, which is what complicates matters.
>
>
>
> I think it is healthy to challenge certain design decisions in Erlang,
> especially because dynamically typed languages tend to have corner cases in
> their semantics which are hard to handle in general.
>
>
>
> On Thu, Apr 13, 2017 at 4:04 PM Minin Maxim <Maxim.Minin@REDACTED>
> wrote:
>
> I'm so stupid today J
>
> Thanks guys (Robert & Stanislaw)
>
> Cheers
>
> Maxim
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170422/1317ec6a/attachment.htm>


More information about the erlang-questions mailing list