Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should Lin implement operator overloading? (and accompanying syntax sugar) #14

Open
NotJustAnna opened this issue Nov 14, 2021 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@NotJustAnna
Copy link
Owner

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 special var$__iterator is added to the scope and the functions var$__iterator.__hasNext() and var$__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.

@NotJustAnna NotJustAnna added enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Nov 14, 2021
@NotJustAnna NotJustAnna modified the milestone: Version 1.0 Nov 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant