On Wed, 2016-04-06 at 16:17, Didier Verna <[email protected]> wrote:
> Mauro <[email protected]> wrote:
>
>> It's a tuple.
>>
>> foo(1,2)
>> (1,2)
>
> and foo(1,2,3) => (1,2,3) and so on. But I still don't understand :-)

Did you find:
http://docs.julialang.org/en/release-0.4/manual/functions/#varargs-functions

Quoting:

It is often convenient to be able to write functions taking an arbitrary
number of arguments. Such functions are traditionally known as “varargs”
functions, which is short for “variable number of arguments”. You can
define a varargs function by following the last argument with an
ellipsis:

julia> bar(a,b,x...) = (a,b,x)
bar (generic function with 1 method)

The variables a and b are bound to the first two argument values as
usual, and the variable x is bound to an iterable collection of the zero
or more values passed to bar after its first two arguments:

julia> bar(1,2)
(1,2,())

julia> bar(1,2,3)
(1,2,(3,))

julia> bar(1,2,3,4)
(1,2,(3,4))

julia> bar(1,2,3,4,5,6)
(1,2,(3,4,5,6))

Reply via email to