3 ms·
1) About mixins and prototypes, exactly. 2) Yes, adding a syntax to easily change instance variable values is one of the most asked features. The tricky part i
by josevalim 16y ago
1) About mixins and prototypes, exactly.
2) Yes, adding a syntax to easily change instance variable values is one of the most asked features. The tricky part is, we cannot do the following:
@foo = "bar"
Because that is pattern matching and in Erlang/Elixir, we cannot modify objects in place. The expression above needs to return a new object.
I was thinking about something like @{'foo : "bar"}, but I haven't decided yet. Suggestions are welcome. :D