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 closure parsing to at-spawn #423

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Add closure parsing to at-spawn #423

wants to merge 2 commits into from

Conversation

jpsamaroo
Copy link
Member

This PR brings Dagger.@spawn closer to Threads.@spawn by allowing an alternative parsing mode when begin ... end blocks are encountered; specifically, such blocks are treated as a function without any arguments, which closes over any captured values.

Todo:

  • Detect closed-over variables (if possible) and pass them as arguments, in case they're thunks/chunks
  • (Alternative) Recurse into closure at runtime to find thunks/chunks and replace them during move
  • (Optional) Implement recursive parsing mode
  • Add tests
  • Add docs

Fixes #421

Add closure mode
Use closure mode for `begin ... end` expressions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dagger's syntax when calling functions with kwards does not match Julia syntax
1 participant