3 ms·
Having now read the entirety of the readme, I'm left a bit unclear on the object model's semantics. If I declare a mixin in an object, those become class method
by Ezku 16y ago
Having now read the entirety of the readme, I'm left a bit unclear on the object model's semantics. If I declare a mixin in an object, those become class methods? Whereas declaring a prototype results in instance methods? Also, "set_ivar" seems like a needlessly complex and obscure statement.
- josevalim 16y ago1) 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