[erlang-questions] Deriving records from one another?

Loïc Hoguin essen@REDACTED
Mon Jun 23 16:23:22 CEST 2014


On 06/23/2014 03:49 PM, Roger Lipscombe wrote:
> Now I'd like to actually start representing *state* with the State[1].
> That is, I'd like to be able to match on #init, #ready,
> #expecting_key, #whatever records. This will hopefully make the code
> easier to read, and means that my record doesn't have to contain
> fields for stuff that's not relevant in the given state.

Don't. Use gen_fsm instead. That's what it's for.

-- 
Loïc Hoguin
http://ninenines.eu



More information about the erlang-questions mailing list