record_info/2

Torbjorn Tornkvist tobbe@REDACTED
Thu Jun 24 21:05:53 CEST 1999


> What I am trying to do is get the list of fields of an object :
> (The aim of the function is to replace a fields value by its name, 
> without specifically knowing what kind of record I am manipulating)

>    Record_name = element(1,Obj),
>    %% Get list of fields
>    List = record_info(fields, Record_name),

record_info/2 is resolved at compile time, so you can't do the above
(Remember, records is just syntactic sugar on top of tuples)

/Tobbe





More information about the erlang-questions mailing list