Skip to content

Commit dae1c9e

Browse files
committed
Fix splitarg example in README
1 parent 0019e82 commit dae1c9e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,14 @@ all_params = [get(dict, :params, [])..., get(dict, :whereparams, [])...]
231231
```
232232
233233
`splitarg(arg)` matches function arguments (whether from a definition or a function call)
234-
such as `x::Int=2` and returns `(arg_name, arg_type, default)`. `default` is `nothing`
235-
when there is none. For example:
234+
such as `x::Int=2` and returns `(arg_name, arg_type, slurp, default)`. `default` is
235+
`nothing` when there is none. For example:
236236
237237
```julia
238-
> map(splitarg, (:(f(a=2, x::Int=nothing, y))).args[2:end])
239-
3-element Array{Tuple{Symbol,Symbol,Any},1}:
240-
(:a, :Any, 2)
241-
(:x, :Int, :nothing)
242-
(:y, :Any, nothing)
238+
> map(splitarg, (:(f(y, a=2, x::Int=nothing, args...))).args[2:end])
239+
4-element Array{Tuple{Symbol,Symbol,Bool,Any},1}:
240+
(:y, :Any, false, nothing)
241+
(:a, :Any, false, 2)
242+
(:x, :Int, false, :nothing)
243+
(:args, :Any, true, nothing)
243244
```

0 commit comments

Comments
 (0)