Milan Bouchet-Valat wrote:
> The first syntax returns an integer: only the second one returns a
> tuple. Parentheses alone only group terms, they don't create a tuple.
Doh! That's what I was missing. Thanks!
--
ELS'16 registration open!
Le mercredi 06 avril 2016 à 16:09 +0200, Didier Verna a écrit :
> Can somebody please explain this to me:
>
> julia> foo(args...) = args
> foo (generic function with 1 method)
>
> foo(1)
> (1,)
>
> i.e., why the trailing comma ?
julia> (1)
1
julia> (1,)
(1,)
The first syntax returns an
Mauro wrote:
> Did you find:
> http://docs.julialang.org/en/release-0.4/manual/functions/#varargs-functions
That's while reading this that the question occurred to me.
--
ELS'16 registration open! http://www.european-lisp-symposium.org
Lisp, Jazz, Aïkido:
On Wed, 2016-04-06 at 16:17, Didier Verna wrote:
> Mauro 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:
Mauro 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 :-)
--
ELS'16 registration open! http://www.european-lisp-symposium.org
Lisp, Jazz, Aïkido: http://www.didierverna.info
> Can somebody please explain this to me:
>
> julia> foo(args...) = args
> foo (generic function with 1 method)
>
> foo(1)
> (1,)
>
> i.e., why the trailing comma ?
It's a tuple.
foo(1,2)
(1,2)
Can somebody please explain this to me:
julia> foo(args...) = args
foo (generic function with 1 method)
foo(1)
(1,)
i.e., why the trailing comma ?
--
ELS'16 registration open! http://www.european-lisp-symposium.org
Lisp, Jazz, Aïkido: http://www.didierverna.info