Questions about records

Bengt Kleberg bengt.kleberg@REDACTED
Tue May 31 10:42:51 CEST 2005


On 2005-05-31 10:23, Enri Enri wrote:
> Hello,
> 
> in the Erlang Documentation there is this sentence:
> "Therefore, record expressions are not understood by
> the shell unless special actions are taken. See
> shell(3) for details"
> Where is "shell(3)"? I presume there is explained how
> to import record definition into the shell, right?

shell(3) means the 3;rd chapter of the man pages, the entry for 'shell'. 
see http://www.trapexit.org/docs/ (to the left) for 'man pages' and 
follow the expanding menues via 'man3' to 'shell'.


> Also, is there an updated grammar? I'm using the bnf
> grammar on Joe's book, but perhaps it's old. See this:
> 
> 15 function_call := "atom" "(" parameter_list ")"
> 
> But this also works:
>   {erlang,round}(3.4)

i think most people on this list tries very hard to forget the latter 
works. :-)


> while this doesn't:
>   -record(t, {x}).
>   f1() -> 
>     R = #t{x={erlang,round}},
>     R#t.x(3.4).
> 
> with parens works:
>   ...
>   (R#t.x)(3.4).

presumably the '.' binds looser than '('. ie 'R#t.x(3.4).' is R#t.(x(3.4)).


bengt



More information about the erlang-questions mailing list