Skip to content

Commit

Permalink
Merge pull request #22799 from bkamins/patch-12
Browse files Browse the repository at this point in the history
Documentation of slurping type constraint
  • Loading branch information
JeffBezanson authored Jul 14, 2017
2 parents 9ea80a4 + b4c2065 commit 1e140a1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/src/manual/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,8 @@ function getindex(A::AbstractArray{T,N}, indexes::Vararg{Number,N}) where {T,N}

would be called only when the number of `indexes` matches the dimensionality of the array.

When only the type of supplied arguments needs to be constrained `Vararg{T}` can be equivalently written as `T...`. For instance `f(x::Int...) = x` is a shorthand for `f(x::Vararg{Int}) = x`.

## Note on Optional and keyword Arguments

As mentioned briefly in [Functions](@ref man-functions), optional arguments are implemented as syntax for multiple
Expand Down

0 comments on commit 1e140a1

Please sign in to comment.