Skip to content

Proposal: Deriving a function from an instance method that is bound/closed-over the instance – instance:method #4512

Closed
@blitmap

Description

@blitmap

Hello -

I was hoping to propose a syntax that would allow you to create a function with a bound/closed-over "this".

instance.method
instance:method
instance:method(...)

Would be:

class::method
class::method.bind(instance)
class::method.bind(instance, ...)

Please forgive me if I got something wrong here... I usually wind up submitting proposals when I'm too tired and there are often typos.

I believe Babel has something like this called the Bind operator:

https://babeljs.io/docs/plugins/transform-function-bind/

@vendethiel: You closed my other issue from yesterday but I corrected some typos :( Please go back and have another look?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions