Erlang hints for an OO junkie

Vlad Balin vlad@REDACTED
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
development
> 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 :)

Vlad Balin




More information about the erlang-questions mailing list