[erlang-questions] How to get more than one clause from one record ?

饕餮 <>
Tue Apr 2 09:20:47 CEST 2013


How to get more than one clause from one record ?

I just know this one:
-record(r,{c1 = 1,c2 = 2}).
#r{c1 = FirstC, c2 = SecondC} = #r{c1 = 1,c2 = 2}.



Then FirstC == 1, SecondC == 2.


It doesn't looks so well.
Because we assign the value from left to right.


Is there any way to write a better-look code?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130402/95aa59ca/attachment.html>


More information about the erlang-questions mailing list