That's very impressive. I used Sequence in Mathematica a lot and its good to know Julia implements similar functionality. What is the overhead for "..."? For example in the case of hcat([i for i=1:3]...). Is it going to be as fast as writing the arguments explicitly like in hcat(1,2,3)?
W dniu czwartek, 3 kwietnia 2014 22:10:08 UTC+2 użytkownik Ethan Anderes napisał: > > I don't know mathematica but it looks like ... does the same thing. I use > it often when I have a function that has a lot of arguments. > > function foo1(x,y,z,w) > sin(x+y+z+w) > end > > fin = [ > 3, > 4, > 5, > 6 > ] > > foo1(fin...) > > It also works for keyword args > > function foo2(;x = 1, y = 2, z = 3, w = 4) > sin(x+y+z+w) > end > > fin = [ > :x => 3, > :y => 4, > :w => 5, > :z =>6 > ] > > foo2(;fin...) > > Cool, right? > >
