[erlang-questions] Record fields

John Doe donpedrothird@REDACTED
Fri Dec 11 15:28:04 CET 2015


you can use this
https://github.com/uwiger/parse_trans/blob/master/src/exprecs.erl parse
transform. It generates access functions for records

2015-12-11 13:53 GMT+03:00 Kirill Ratkin <kvratkin@REDACTED>:

> Hi!
>
> I'm trying to get records fields at runtime.
> If I have record 'test' and I can do:
> record_info(fields, test).
>
> But if I do:
> R = test,
> record_info(fields, R).
>
> I get error :
> * 1: illegal record info.
>
> Documentation says: To each module using records, a pseudo function is
> added during compilation to obtain information about records.
>
> It seems it's really 'pseudo' function ....
>
> Is there alternative way to get record fields in runtime?
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151211/2b158e61/attachment.htm>


More information about the erlang-questions mailing list