[erlang-questions] OTP Design Principles doc bug (Gen Server Behaviour: 2.5)

Bob Ippolito bob@REDACTED
Mon Mar 12 00:36:38 CET 2007

I'm pretty sure there is a documentation error in the example code here:

When the request is received, the gen_server calls
handle_cast(Request, State) which is expected to return a tuple
{noreply, State1}. State1 is a new value for the state of the

handle_call({free, Ch}, Chs) ->
    Chs2 = free(Ch, Chs),
    {noreply, Chs2}.

I would expect this example to be:

handle_cast({free, Ch}, Chs) ->
    Chs2 = free(Ch, Chs),
    {noreply, Chs2}.


More information about the erlang-questions mailing list