Skip to content

Instantly share code, notes, and snippets.

@talentdeficit
Created September 2, 2010 04:40
Show Gist options
  • Save talentdeficit/561880 to your computer and use it in GitHub Desktop.
Save talentdeficit/561880 to your computer and use it in GitHub Desktop.
lists:foldl(fun add_to_record/2, #record{}, List).
add_to_record({first_name, Value}, Rec) ->
Rec#record{first_name = Value};
add_to_record({last_name, Value}, Rec) ->
Rec#record{last_name = Value};
add_to_record({age, Value}, Rec) ->
Rec#record{age = Value};
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment