<html><head><style type="text/css"><!-- DIV {margin:0px} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">(Sorry about top-posting, I'm trying out Yahoo's new mail system)<br><br>When debugging, try rr and friends.<br>
<br>Records disappear at compile-time, but have a look at record_info/2 as a tool for rolling your own. (E.g., good old record_info(fields, my_rec) is expanded to a list of the field names of my_rec.)<br><br>(The preferrable approach would be to make records into first-class entities, but Erlang is locked into the "records = tuples" representation.)<br><br>Best,<br>Thomas<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Dmitrii Dimandt <dmitriid@gmail.com><br>To: erlang-questions <erlang-questions@erlang.org><br>Sent: Wednesday, September 20, 2006 9:46:35 AM<br>Subject: [erlang-questions] Record information<br><br>Is there a way to find information on a record? That is, what fields it contains, etc.?<br><br>That is, if I have a record like this:<br><br>-record(<br> forumRequest,<br>
{<br> userName,<br> password
<br> }<br>).<br><br>And I have A = #forumRequest(userName = "login", password = "pass").<br><br>I can find out the name of the record by doing element(1, A). Can I find out that "login" is a userName and "pass" is password?
<br><div>_______________________________________________<br>erlang-questions mailing list<br>erlang-questions@erlang.org<br><a target="_blank" href="http://www.erlang.org/mailman/listinfo/erlang-questions">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br></div></div><br></div></div></body></html>