[erlang-questions] untyped records

Tim erlang@REDACTED
Tue Jul 2 21:46:44 CEST 2013


Greetings,

I'm getting an untyped record from a web form submission.  io_lib:format("~p", [MyRecord]) displays:

{struct,[{code,1372793577767},
        {desc,"e7iOSxy6PYQiMRk87r5cHK4DVAUj5SzI"},
        {units,"g|Kg"}]}

Now, I know if I define a record myself, I can access fields using the format:  Name#type.field

but in this case the type of record is unknown.

MyRecord#struct.desc returns a 'record struct undefined' error at compile time.

Can I access the fields of this record without deconstructing it?

Cheers.


More information about the erlang-questions mailing list