Skip to content

Instantly share code, notes, and snippets.

@nmichaels
Created October 8, 2011 20:07
Show Gist options
  • Save nmichaels/1272799 to your computer and use it in GitHub Desktop.
Save nmichaels/1272799 to your computer and use it in GitHub Desktop.
-define(make_record_to_list(Record),
record_to_list(Val = #Record{}) ->
Fields = record_info(fields, Record),
[_Tag| Values] = tuple_to_list(Val),
lists:zip(Fields, Values)
).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment