Re: [julia-users] Re: function! vs. function

2016-06-12 Thread digxx
> > Indeed embarassing -.- But yeah I was just confused thx anyway.

Re: [julia-users] Re: function! vs. function

2016-06-12 Thread Yichao Yu
On Sun, Jun 12, 2016 at 2:27 PM, digxx wrote: > Thx evan. > just to clarify: when calling: > function f(a,farr) > for i=1:n > for j=1:n > farr[j,i] = (a[j,:]*a[:,i] - A[j,:]*a[:,i])[1] - k2[j,i] > end > end > end > > f(x) with my previously defined x I get an error > >

[julia-users] Re: function! vs. function

2016-06-12 Thread Kristoffer Carlsson
You probably defined an f!(x) function earlier in your REPL session. Restart the REPL or run workspace()and try again. On Sunday, June 12, 2016 at 8:27:32 PM UTC+2, digxx wrote: > > Thx evan. > just to clarify: when calling: > function f(a,farr) > for i=1:n > for j=1:n > farr[j,i] =

[julia-users] Re: function! vs. function

2016-06-12 Thread digxx
Thx evan. just to clarify: when calling: function f(a,farr) for i=1:n for j=1:n farr[j,i] = (a[j,:]*a[:,i] - A[j,:]*a[:,i])[1] - k2[j,i] end end end f(x) with my previously defined x I get an error while calling function f!(a,farr) for i=1:n for j=1:n farr[j,i] = (a[j,:]*a[:,i] -

[julia-users] Re: function! vs. function

2016-06-12 Thread Evan Fields
Apologies if this is obvious, but: appending ! to a function name doesn't do anything special. It is convention to "append ! to names of functions that modify their arguments" (from the manual, section style guide). But this is just a naming convention and doesn't affect how the function is

Re: [julia-users] Re: function! vs. function

2016-06-12 Thread Milan Bouchet-Valat
Le dimanche 12 juin 2016 à 10:13 -0700, digxx a écrit : > the function I defined above? Or what do you mean? > function f!(a,farr) > for i=1:n > for j=1:n > farr[j,i] = (a[j,:]*a[:,i] - A[j,:]*a[:,i])[1] - k2[j,i] > end > end > end That method requires two

[julia-users] Re: function! vs. function

2016-06-12 Thread digxx
the function I defined above? Or what do you mean? function f!(a,farr) for i=1:n for j=1:n farr[j,i] = (a[j,:]*a[:,i] - A[j,:]*a[:,i])[1] - k2[j,i] end end end