On Monday, November 23, 2015 at 6:44:58 PM UTC+1, Yichao Yu wrote: > > > I have a function that returns a tuple. > > But I only want the second value of this tuple. > > So I tried `(,a) =f()`. But it does not work. > > > > I'd like to is there any syntax which works? > > Note `(a,) = (1,2)` does work. > > I don't think it's too useful.... you can just do `a = f()[2]` or `_, a = > f()` > In the second example, it will overwrite `_`.
- [julia-users] `(,a) = (1,2)` returns an error Sisyphuss
- Re: [julia-users] `(,a) = (1,2)` returns an error Yichao Yu
- Re: [julia-users] `(,a) = (1,2)` returns an err... Sisyphuss
- [julia-users] Re: `(,a) = (1,2)` returns an error Ilya Orson
- [julia-users] Re: `(,a) = (1,2)` returns an error Sisyphuss
- [julia-users] Re: `(,a) = (1,2)` returns an err... Seth
- Re: [julia-users] Re: `(,a) = (1,2)` return... Zheng Wendell
- Re: [julia-users] Re: `(,a) = (1,2)` re... Steven G. Johnson
- Re: [julia-users] Re: `(,a) = (1,2... Zheng Wendell
