Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

WIP: feat: Add closures exercises #2099

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

Open
junderw wants to merge 3 commits into rust-lang:main
base: main
Choose a base branch
Loading
from junderw:add/closures

Conversation

Copy link
Contributor

@junderw junderw commented Sep 2, 2024

Closes #1746

This is just something to work off of as a start.

I was thinking that maybe 2 would show various syntax errors when writing closures. Maybe we want to mention that non-capturing closures coerce to fn pointers here.

3 could be about capturing and using the move keyword to get fine grained control over capturing. This should also mention lifetimes, so when a closure captures outside state, it holds on to a reference in general. This might need to be split up into multiple lessons.

4 could be about how usage of captured state dictates which Fn traits the closure can implement.

I'm thinking once we flesh things out and spread things apart it should be about 5-6 lessons in the chapter.

I forfeit all copyright to the works in the PR so anyone can take over if I become unresponsive/busy.

I should be around though. Please feel free to make a pull request towards my fork if anyone has suggestions pre-merge.

Thanks

irfanghat reacted with thumbs up emoji
@junderw junderw mentioned this pull request Nov 1, 2024
@junderw junderw changed the title (削除) feat: Add closures exercises (削除ここまで) (追記) WIP: feat: Add closures exercises (追記ここまで) Nov 1, 2024
@mo8it mo8it added this to the v7 milestone Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

v7

Development

Successfully merging this pull request may close these issues.

Closures

2 participants

AltStyle によって変換されたページ (->オリジナル) /