Open Akuli opened 6 months ago
Interesting use of ->
for attributes.
Jou's ->
is just like in C: foo->bar
is equivalent to (*foo).bar
, so you use it when foo
is a pointer to an instance of a class.
I should document classes :)
I just interpreted it as accessing a class instances attribute.
I had something like this:
Note that last line should have
self->
in two places, but the second one isself.
instead. The error message I got was:This is a bad error message, because fields of self can be incremented, you just need to do it using the
->
operator instead of the.
operator.