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

parser: Assorted improvements #533

Merged
merged 5 commits into from
Jun 19, 2024
Merged

parser: Assorted improvements #533

merged 5 commits into from
Jun 19, 2024

Conversation

jpsamaroo
Copy link
Member

Uses MacroTools' @capture in the @spawn parser to parse calls, and in the process adds support for do-block syntax and direct calls to anonymous functions:

# Do-block syntax
Dagger.@spawn sum(A) do a
  return a+1
end

# Direct call to anonymous function
Dagger.@spawn A->sum(A; dims=1)+2

This should make it easier for users to apply Dagger.@spawn to arbitrary calls. Note that I am not tackling #514, as that is significantly more difficult to do (it requires finding and transforming all values which might be a DTask).

Fixes #480
Fixes #479
Fixes #421

@jpsamaroo jpsamaroo merged commit b2fd2ab into master Jun 19, 2024
9 of 12 checks passed
@jpsamaroo jpsamaroo deleted the jps/parser-fixes branch June 19, 2024 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant