I see your point, but the counter argument is that it makes it fairly easy to introduce a bug into your code, ie typing out a couple of keyword arguments, mind still on the previous entry, and you accidentally type in the same name twice - I know it can happen, because it is exactly how I stumbled onto this :-)
I've filed an issue here: https://github.com/JuliaLang/julia/issues/16937, so it might be worthwhile if you head over and make your point there, as I agree this is definitely arguable for either side. Cheers, Colin On Sunday, 12 June 2016 23:50:32 UTC+10, Tom Breloff wrote: > > I just want to point out that this is a feature in my eyes, not a bug. > It's very useful as a keyword override when splatting keywords. > > On Sunday, June 12, 2016, Milan Bouchet-Valat <[email protected] > <javascript:>> wrote: > >> Le samedi 11 juin 2016 à 19:46 -0700, [email protected] a écrit : >> > I can enter the same keyword argument twice, and the second entry is >> > the one that gets used. A short example follows: >> > >> > f(x::Int ; kw::Int=0) = x * kw >> > f(2) >> > f(2, kw=3) #evaluates to 6 >> > f(2, kw=3, kw=4) #evaluates to 8 >> > >> > Is this desired behaviour or is it a bug? Based on a quick scan, I >> > can't quite tell if this is the same bug as issue 9535 >> > (https://github.com/JuliaLang/julia/issues/9535), so thought I would >> > post here before filing anything. Also, I'm on v0.4, so I don't want >> > to file if this is already taken care of in v0.5. >> It also happens on 0.5. This sounds like a different (and simpler) bug >> than #9535, so filing a new issue would likely be useful. Even if it >> was done on purpose, the manual doesn't seem to mention it. >> >> >> Regards >> >
