Skip to content

Change function signatures of expansion functions of macros to be synchronous #2546

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

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Aug 15, 2024

The different macro proposals have been inconsistent about whether the expansion function should be synchronous or asynchronous.

  • Synchronous
    • SE-0415 Function Body Macros
    • SE-0402 Extension Macros
    • SE-0407 Member Macro Conformances
    • SE-0397 Freestanding Declaration Macros (but future directions uses async function)
  • Async
    • SE-0389 Attached Macros
    • SE-0382 Expression Macros

swift-syntax has always implemented synchronous expansion functions. Update the proposals to consistently use synchronous expansion functions to reflect that.

@ahoppen ahoppen force-pushed the sync-expansion-function branch from b485187 to 9f0ce55 Compare August 15, 2024 19:50
@xwu xwu added content change Content change to an existing document LSG Contains topics under the domain of the Language Steering Group labels Aug 15, 2024
@xwu
Copy link
Contributor

xwu commented Aug 20, 2024

@ahoppen Would you mind adding a line to the revision history of attached macros as well? Otherwise, the LSG has agreed we should update the proposals as shown here and I will post an announcement on it.

…ynchronous

The different macro proposals have been inconsistent about whether the expansion function should be synchronous or asynchronous.

- Synchronous
  - SE-0415 Function Body Macros
  - SE-0402 Extension Macros
  - SE-0407 Member Macro Conformances
  - SE-0397 Freestanding Declaration Macros (but future directions uses `async` function)
- Async
  - SE-0389 Attached Macros
  - SE-0382 Expression Macros

swift-syntax has always implemented synchronous expansion functions. Update the proposals to consistently use synchronous expansion functions to reflect that.
@ahoppen ahoppen force-pushed the sync-expansion-function branch from 9f0ce55 to 295276e Compare August 20, 2024 21:51
@ahoppen
Copy link
Member Author

ahoppen commented Aug 20, 2024

@xwu Updated the attached macros proposal to have an entry in the revision history

@xwu xwu merged commit aa207ff into swiftlang:main Aug 21, 2024
@ahoppen ahoppen deleted the sync-expansion-function branch December 4, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content change Content change to an existing document LSG Contains topics under the domain of the Language Steering Group
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants