Macros | Documentation
Macros transform your source code when you compile it, letting you avoid writing repetitive code by hand. During compilation, Swift expands any macros in your code before building your code as usual. Expanding a macro is always an additive operation: Macros add new code, but they never delete or modify existing code. Both the input to a macro and the output of macro expansion are checked to ensure they’re syntactically valid Swift code. Likewise, the values you pass to a macro and the values in code generated by a macro are checked to ensure they have the correct types. In addition, if the macro’s implementation encounters an error when expanding that macro, the compiler treats this as a compilation error. These guarantees make it easier to reason about code that uses macros, and they make it easier to identify issues like using a macro incorrectly or a macro implementation that has a bug. Swift has two kinds of macros: Freestanding macros appear on their own, without being attached to
To navigate the symbols, press Up Arrow, Down Arrow, Left Arrow or Right Arrow No items were found 1 item was found {number} items were found. Tab back to navigate through them. re looking for can't be found."},"color-scheme":{"select":"Select a color scheme preference","auto":"Auto","dark":"Dark","light":"Light"},"accessibility":{"strike":{"start":"start of stricken text","end":"end of stricken text"},"code":{"start":"start of code block","end":"end of code block"},"skip-navigation":"Skip Navigation","in-page-link":"in page link"},"select-language":"Select the language for this page","icons":
Explore this link on the map →related reading
- Documentationdocs.swift.org
- bookbear express | Ava | Substackavabear.xyz
- Codex use casesdevelopers.openai.com
- Documentationdocs.swift.org
- llm-wiki · GitHubgist.github.com
- GitHub - shroominic/codeinterpreter-api: 👾 Open source implementation of the ChatGPT Code Interpreter · GitHubgithub.com
- Impeccable: The missing upgrade to Anthropic's impeccable skillimpeccable.style
- Prompt guidance | OpenAI APIdevelopers.openai.com
- Documentationdocs.swift.org
- GitHub - ByteByteGoHq/system-design-101: Explain complex systems using visuals and simple terms. Help you prepare for system design interviews. · GitHubgithub.com
- GitHub - x1xhlol/system-prompts-and-models-of-ai-tools: FULL Augment Code, Claude Code, Cluely, CodeBuddy, Comet, Cursor, Devin AI, Junie, Kiro, Leap.new, Lovable, Manus, NotionAI, Orchids.app, Perplexity, Poke, Qoder, Replit, Same.dev, Tragithub.com
- Documentationdocs.swift.org