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

Add a &self context to Func #138

Open
ExpHP opened this issue Nov 24, 2018 · 2 comments
Open

Add a &self context to Func #138

ExpHP opened this issue Nov 24, 2018 · 2 comments
Milestone

Comments

@ExpHP
Copy link
Collaborator

ExpHP commented Nov 24, 2018

If #137 gets merged, then Func will take no context while FuncMut takes a &mut context. For consistency, Func should be revised to take a &self context.

IMO, poly_fn! still should remain limited to defining Funcs with unit context, because it is too complicated to define an ergonomical grammar for a macro that allows the function to capture anyhing. In other words, to take advantage of this new feature will require a manual Func impl.

@Centril
Copy link
Collaborator

Centril commented Nov 24, 2018

I'm working on a proposal to add generic closures to Rust itself in any case so that seems OK. :)

@ExpHP
Copy link
Collaborator Author

ExpHP commented Nov 24, 2018

That sounds boss.

@ExpHP ExpHP added this to the 0.3 milestone Feb 26, 2019
@lloydmeta lloydmeta modified the milestones: 0.3, 0.4 May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants