[erlang-questions] pattern matching with records in a function

Sergey Shilov hsvhome@REDACTED
Tue Apr 10 21:51:52 CEST 2012


On 10 апреля 2012 16:25:49 Pablo Vieytes wrote:

> -record(inputmsg, {action, data1, ..., datan}).
...   
> and I needed data1...datan in action_x().

handle_cast(#inputmsg{}=Msg, State) ->
     [_,X|Data] = tuple_to_list(Msg),
     ...

-- 
V.B.R Sergey Shilov.



More information about the erlang-questions mailing list