Question about records

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Question about records

Fredrik Linder-2
Hi

I hope this makes it clearer:

With

-record(a, {b, c}).

1> A1 = #a{}.
{a, undefined, undefined}.
2> A1#a.b.
undefined.
3> A1#A.c.
undefined.
4> A2 = #a{b = 1}.
{a, 1, undefined}.
5> A2#a.b.
1
6> lists:foldl(fun(A, Acc) -> Acc end, #a{}, [1]).
[{a, undefined, undefined}].

Merry Christmas
/Fredrik

> -----Original Message-----
> From: owner-erlang-questions
> [mailto:owner-erlang-questions]On Behalf Of Dietmar Admin
> Schaefer
> Sent: den 22 december 2004 13:27
> To: 'Erlang Questions List'
> Subject: Question about records
>
>
> Hi !
>
>
> I have:
>
> -record(cmmc_config,{...}).
>
>
> after reading the docs (more or less carefully) it's not yet
> clear to me
>
>
> what   lists:foldl(F, #cmmc_config{}, Lines) means.
> (#cmmc_config{} is the point)
>
>
> regards
>
>
>
> Dietmar
>