[erlang-questions] Accessing default values of a record
Sean Hinde
sean.hinde@REDACTED
Tue Jan 9 13:50:41 CET 2007
On 9 Jan 2007, at 12:36, Vlad Dumitrescu wrote:
> Hi,
>
> On 1/9/07, Sean Hinde <sean.hinde@REDACTED> 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.
Actually not. The point is that I need the record name to be a
variable. I want to iterate through a list of record names and create
a default record for each one.
Sean
More information about the erlang-questions
mailing list