Closed KCreate closed 7 years ago
Method names for the overloaded operators should be (for now)
+
= __plus
-
= __minus
*
= __mult
/
= __divd
%
= __mod
**
= __pow
!
= __unot
-
= __uminus
<
= __less
>
= __greater
<=
= __lessequal
>=
= __greaterequal
==
= __equal
!
= __notequal
[]
= __member
[] =
= __member_write
++
= __pplus
--
= __pminus
The ++
and --
operators will be added in a seperate PR
Implemented via #58
When doing a member expression or index expression on a non-object or non-array, the interpreter should look for a function on classes defined in
primitives.charly
.This could work like this:
Every class function or object function will get a pointer called
self
that will always point to the current object the function runs in. In this case it will be pointed to a primitive value. The interpreter redirects these calls at runtime.