WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

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

@NotJustAnna

Description

@NotJustAnna

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions