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

Function .bind. Then .call and .apply #59

Open
kaleidawave opened this issue Sep 13, 2023 · 0 comments
Open

Function .bind. Then .call and .apply #59

kaleidawave opened this issue Sep 13, 2023 · 0 comments
Labels
checking Issues around checking enhancement New feature or request good-second-issue Moderately difficult issue
Milestone

Comments

@kaleidawave
Copy link
Owner

Function .bind should be implemented as a constant function which creates a new Function type with the ThisValue set to the first argument.

Then once that is added .call and .apply can be added as constant functions

interface Function {
    bind(value): Function performs const bind;

    call(this_ty, ...arguments): any performs {
        return this.bind(this_ty)(...arguments)
    }

    apply(this_ty, arguments): any performs {
        return this.bind(this_ty)(...arguments)
    }
}

something like that

Not sure how checking will work...?

Also the this_value of call_type should be removed. The only this is from the type itself

@kaleidawave kaleidawave added enhancement New feature or request good-second-issue Moderately difficult issue checking Issues around checking labels Sep 13, 2023
@kaleidawave kaleidawave added this to the 0.1.0 milestone Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
checking Issues around checking enhancement New feature or request good-second-issue Moderately difficult issue
Projects
None yet
Development

No branches or pull requests

1 participant