pretty printing of records

Vlad Dumitrescu XX (LN/EAB) <>
Wed Aug 10 10:37:12 CEST 2005


Hi,
 
Using record_info is a compile-time option - you can only do it in a module where the record is defined. Which is fine most of the time.
 
For the mode advanced use, there is a contribution in jungerl (lib/msc/src/rec_info.erl) that will use the tricks from shell.erl to take a record and a module where it is defined and return a list of {key, value}s. This works dynamically, retrieving the record definition from the module's beam or the source. Of course, you still need to know of a module where this record is used.
 
It's not at all optimized, but might be useful. One issue is that retrieving record info from a source file requires compiling it...
 
best regards,
Vlad
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20050810/c2cd39dc/attachment.html>


More information about the erlang-questions mailing list