Erlang hints for an OO junkie
Tue Aug 10 19:03:17 CEST 2004
> invoke( Object, Method, Params ) ->
> apply( getelement( 0, Object ), Method, [ Object | Params ] ).
> I think you got an idea. I believe that people who have an experience of
> in Erlang could suggest more effective and elegant approaches.
like this, for example ;)
class( Object ) -> element( 0, Object ).
generic_function( Object ) ->
Class = class( Object ),
Class:callMethod( Object ).
Hope have not made mistakes now :)
More information about the erlang-questions