File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,8 @@ resulting expression is substituted directly into the program at the point where
158
158
the macro is invoked.
159
159
Macros are a way to run generated code without calling [`eval`](@ref Base.eval), since the generated
160
160
code instead simply becomes part of the surrounding program.
161
- Macro arguments may include expressions, literal values, and symbols.
161
+ Macro arguments may include expressions, literal values, and symbols. Macros can be defined for
162
+ variable number of arguments (varargs), but do not accept keyword arguments.
162
163
163
164
# Examples
164
165
```jldoctest
@@ -169,6 +170,14 @@ julia> macro sayhello(name)
169
170
170
171
julia> @sayhello "Charlie"
171
172
Hello, Charlie!
173
+
174
+ julia> macro saylots(x...)
175
+ return :( println("Say: ", \$ (x...)) )
176
+ end
177
+ @saylots (macro with 1 method)
178
+
179
+ julia> @saylots "hey " "there " "friend"
180
+ Say: hey there friend
172
181
```
173
182
"""
174
183
kw " macro"
You can’t perform that action at this time.
0 commit comments