Should Lin implement operator overloading? (and accompanying syntax sugar) #14
Labels
enhancement
New feature or request
help wanted
Extra attention is needed
question
Further information is requested
1. Should Lin implement operator overloading?
Currently, all (but one) operations is handled directly by the VM. Type checks are made and, if matched, an specified behaviour is computed.
The one exception is the for loop, where a special
__iterator()
function is called, a specialvar$__iterator
is added to the scope and the functionsvar$__iterator.__hasNext()
andvar$__iterator.__next()
are called accordingly.This made me want to open the discussion: Should this behaviour extend to other operators?
2. Should Lin implement syntax sugar for operator overloading?
The first question made me wonder weather we should add some kind of syntax sugar for
operator fun
, basically syntax sugar which validates how many parameters your function should have and correctly maps a cleaner name to the underlying identifiers.The text was updated successfully, but these errors were encountered: