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

WIP: feat: Add closures exercises #2099

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

junderw
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

@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Closures
2 participants