[erlang-questions] [erlang-bugs] parser/preprocessor bug
Joe Armstrong
erlang@REDACTED
Fri Nov 18 15:46:16 CET 2011
On Fri, Nov 18, 2011 at 2:16 PM, Vlad Dumitrescu <vladdu55@REDACTED> wrote:
> Hi,
>
> On Fri, Nov 18, 2011 at 14:11, Joe Armstrong <erlang@REDACTED> wrote:
> > -module(bug).
> > -compile(export_all).
> > -record(bug,{a}).
> > test() ->
> > [#bug{a=1} #bug{a=2}].
>
> It's not a bug, it's the same as
>
> test() ->
> B = #bug{a=1},
> [B#bug{a=2}].
>
>
Ouch - oh dear you're right.
When I wrote this I thought #bug{a=1} is syntactic sugar for {bug,1}
therefore [#bug{a=1} #bug{a=2}] is the same as [{bug1,} {bug,2}] which is
an invalid list.
/J
> regards,
> Vlad
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111118/a7491f98/attachment.htm>
More information about the erlang-questions
mailing list