Re: [julia-users] Weird singleton varags display

2016-04-06 Thread Didier Verna
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!

Re: [julia-users] Weird singleton varags display

2016-04-06 Thread Milan Bouchet-Valat
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

Re: [julia-users] Weird singleton varags display

2016-04-06 Thread Didier Verna
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:

Re: [julia-users] Weird singleton varags display

2016-04-06 Thread Mauro
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:

Re: [julia-users] Weird singleton varags display

2016-04-06 Thread Didier Verna
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

Re: [julia-users] Weird singleton varags display

2016-04-06 Thread Mauro
> 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)

[julia-users] Weird singleton varags display

2016-04-06 Thread Didier Verna
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