record_to_proplist/3

This commit is contained in:
Feng Lee 2015-10-30 18:00:36 +08:00
parent 19930b6382
commit 4ee2abdbcf
1 changed files with 4 additions and 0 deletions

View File

@ -29,3 +29,7 @@
lists:zip(record_info(fields, Def),
tl(tuple_to_list(Rec)))).
-define(record_to_proplist(Def, Rec, Fields),
[{K, V} || {K, V} <- ?record_to_proplist(Def, Rec),
lists:member(K, Fields)]).