[erlang-questions] [ANN] Elixir v0.5.0 released

José Valim jose.valim@REDACTED
Fri May 25 20:12:44 CEST 2012


Actually, a better answer to this question would be: it should be easy for
you to create a macro that will generate the appropriate handle_call or
handle_cast functions based on a record. Here is a spike (I haven't tested
it, but you will have an idea):

https://gist.github.com/fb133f91db77a9938d57

Feel free to ping me by e-mail if you want to go further into this. :)


*
José Valim
www.plataformatec.com.br
Founder and Lead Developer
*


On Fri, May 25, 2012 at 6:19 PM, José Valim <jose.valim@REDACTED> wrote:

> Is it possible to use elixir to emulate objects on top of gen_server
>> with their "instance variables" which are just fields of record?
>>
>
> Elixir does not have the concept of objects. So you have to do the same as
> Erlang. You need to create a record and access/manipulate the records
> fields. There is a difference that Elixir records are not a preprocessor
> feature, so access/manipulation is less verbose.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120525/90179d6a/attachment.htm>


More information about the erlang-questions mailing list