Advertisement
Guest User

Untitled

a guest
Aug 31st, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. 1> L = [{a, 1}. {b,2}, {c, 3}, {d, 4}].
  2.  
  3. proplists:get_value(a, L).
  4. proplists:get_value(b, L).
  5. ...
  6. proplists:get_valus(d, L).
  7.  
  8. [{a, 1}. {b,2}, {c, 3}, {d, 4}] = L.
  9.  
  10. [{a, A}, {b, B}, {c, C}, {d, D}] = L,
  11.  
  12. [A, B, C, D] = [ proplists:get_value(X, L) || X <- [a,b,c,d] ],
  13.  
  14. A = proplists:get_value(a, L),
  15. B = proplists:get_value(b, L),
  16. C = proplists:get_value(c, L),
  17. D = proplists:get_value(d, L),
  18.  
  19. [A, B, C, D] = [ V || Key <- [a,b,c,d], {K, V} <- L, K =:= Key ],
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement