Erlang hints for an OO junkie?

Marc van Woerkom Marc.Vanwoerkom@REDACTED
Mon Aug 9 18:29:35 CEST 2004


>>From the perspective of an OO programmer, in another 
>>language my choice
>would've been a hierarchy of classes somewhat like the 
>following:
>
>ANIMAL <- LIVING <- OBJECT
>BACKPACK <- CONTAINER <- OBJECT
>SWORD <- WEAPON <- (OBJECT, DAMAGE_SOURCE)
>ARMOR <- WEAPON <- (OBJECT, DAMAGE_SINK)

What do you need the hierarchy for?
In OO you most likely need it for polymorphism, like a 
virtual function container.open() that works for backpacks 
and treasure chests.

In Erlang your object might be some process and you send 
it some "open" message.

Michael Remond features some multiplayer game in his 
book/on the net, perhaps he some suggestion.

Regards,
Marc




More information about the erlang-questions mailing list