[erlang-bugs] compile and syntax_tools disagree

Ulf Wiger (TN/EAB) <>
Tue Apr 3 14:22:05 CEST 2007


I didn't miss out on it. I was trying to 
keep the email short. (:

The way I read the documentation in it's current
state is that it is supposed to work as syntax_tools  
does, where

[G1, G2, ...] is a conjunction of guards, and 
[[G11,G12,...],[G21,G22,...],...] is a disjunction.

I have no problem with the compiler requiring 
[[G]] rather than [G]. I have changed the output
of my code generator to this, since clearly - 
bug or no bug - this would have been a correct
pattern.

If Rep(Gss) had been used, as you suggest, it 
would indeed have been more obvious, and also 
correctly described the current behaviour of
the compiler.  ,-)

BR,
Ulf W

> -----Original Message-----
> From: Richard Carlsson [mailto:] 
> Sent: den 3 april 2007 13:01
> To: Ulf Wiger (TN/EAB)
> Cc: Bjorn Gustavsson; 
> Subject: Re: [erlang-bugs] compile and syntax_tools disagree
> 
> Ulf Wiger (TN/EAB) wrote:
> > Maybe it's just I who don't understand how to read the doc 
> on abstract 
> > forms, but quoted from 
> > 
> http://www.erlang.org/doc/doc-5.5.4/erts-5.5.4/doc/html/part_frame.htm
> > l
> > 
> > "If C is a function clause ( Ps ) when Gs -> B where Ps is 
> a pattern 
> > sequence, Gs is a guard sequence and B is a body, then
> > Rep(C) = {clause,LINE,Rep(Ps),Rep(Gs),Rep(B)}. 
> > ...
> > A guard Gs is a nonempty sequence of guard tests G_1, ..., G_k, and 
> > Rep(Gs) = [Rep(G_1), ..., Rep(G_k)].
> 
> Don't miss the immediately following paragraph:
> 
> "A guard sequence Gss is a sequence of guards Gs_1; ...; Gs_k, and
> Rep(Gss) = [Rep(Gs_1), ..., Rep(Gs_k)]. If the guard sequence 
> is empty,
> Rep(Gss) = []."
> 
> The description of {clause, ...} that you quote above says 
> "Gs is a guard sequence". It would have been more obvious if 
> that paragraph had used Gss instead of Gs.
> 
>      /Richard
> 
> 




More information about the erlang-bugs mailing list