You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To align with JS/C#, an implicit this parameter should be provided to function calls. Later we can expand on this and provide this also in scopes.
Behaviour of implicit this should mimic JS where possible.
Account={balance: 100,withdraw: (howMuch)=>{this.balance-=howMuchreturnthis.balance;}}print(Account.withdraw(40))// prints 60
Currently, we would need to either pass a reference to Account explicitely as a param or use Account::withdraw & declare function withdraw via : notation.
It is for a consideration whether to implement this via prepending this in existing BuildArgumentList or to use a different mechanism.
Regardless of that, explicit params called this should be illegal and we should throw at compiletime when we encounter such a param.
functionmyFn(this){// <-- throws "a parameter at position X can't be named "this")}