[erlang-questions] Accessing default values of a record

Vlad Dumitrescu <>
Tue Jan 9 13:36:50 CET 2007


Hi,

On 1/9/07, Sean Hinde <> wrote:
> But there seems to be no obvious way to access default values in the
> new record definition. This would be useful to give new fields in the
> transformed tables nice default values.
>
> One way to achieve this would be to provide a mechanism akin to
> record_info, but which constructs a default record from its name e.g.

In jungerl/lib/msc/rec_info.erl you can see how to transform a record
into a {key, value} list. By calling rec_info:to_list(#your_record(),
you will get the default values of the fields.

Hope this helps.
regards,
Vlad



More information about the erlang-questions mailing list