Re: [julia-users] keyword argument function masking non-kwarg function

2014-08-22 Thread Stefan Karpinski
Simultaneous dispatch on positional and keyword arguments just seems nuts. Jeff and I spent a lot of time talking about that and could never come up with anything that seemed sane or comprehensible, so it ended up being what it is now. Another option would be to dispatch on positional arguments fir

Re: [julia-users] keyword argument function masking non-kwarg function

2014-08-21 Thread Kevin Squire
Yes, that was considered, but was never implemented. Best I could find is https://github.com/JuliaLang/julia/issues/485#issuecomment-15848966. On Thu, Aug 21, 2014 at 10:01 AM, Toivo Henningsson wrote: > I believe it was considered at some point to let dispatch distinguish > between functions

Re: [julia-users] keyword argument function masking non-kwarg function

2014-08-21 Thread Toivo Henningsson
I believe it was considered at some point to let dispatch distinguish between functions taking keyword arguments and functions taking no keyword arguments?

Re: [julia-users] keyword argument function masking non-kwarg function

2014-08-21 Thread John Myles White
Unfortunately, the rule is simple: "dispatch never looks at keyword arguments." -- John On Aug 21, 2014, at 8:59 AM, Spencer Lyon wrote: > Consider the following code: > > function periodogram(x::Array) > n = length(x) > I_w = abs(fft(x)).^2 ./ n > w = 2pi * [0:n-1] ./ n # Fourie

[julia-users] keyword argument function masking non-kwarg function

2014-08-21 Thread Spencer Lyon
Consider the following code: function periodogram(x::Array) n = length(x) I_w = abs(fft(x)).^2 ./ n w = 2pi * [0:n-1] ./ n # Fourier frequencies # int rounds to nearest integer. We want to round up or take 1/2 + 1 to # make sure we get the whole interval from [0, pi] in