[erlang-questions] What does ":gen" do in this case?

Thomas Allen thomas@REDACTED
Tue Jul 9 18:45:13 CEST 2013


It calls the function `gen/2' in the `cortex' module.

Thomas


On Tue, Jul 9, 2013, at 09:43 AM, Yves S. Garret wrote:
> I'm looking at this code:
> 
> spawn_CerebralUnits(IdsNPIds, CerebralUnitType, [Id | Ids])->
>   PId = CerebralUnitType:gen(self(), node()),
>   ets:insert(IdsNPIds, {Id, PId}),
>   ets:insert(IdsNPIds, {PId, Id}),
>   spawn_CerebralUnits(IdsNPIds, CerebralUnitType, Ids);
> spawn_CerebralUnits(_IdsNPIds, _CerebralUnitType, [])->
>   true.
> 
> On the line where PId is bound, you have this
> "CerebralUnitType:gen(self(), node()),".  CerebralUnitType is an atom
> "cortex".  So
> what does :gen do in this case?
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list