On 9 April 2016 at 00:09, Tom Breloff <[email protected]> wrote: > > The `plot!` command is primarily `plot!(plt::AbstractPlot, args...; > kw...)`. In this case it holds to convention. > > I have a convenience `current()` which stores the most recently updated > AbstractPlot object in a global, so that any plotting command without a > leading AbstractPlot object gets it added implicitly. (i.e. a call to > `plot!(...)` is really a call to `plot!(current(), ...)`). > > I think this strategy is better than alternatives, and isn't too far from > accepted conventions. >
I understand that to you this seems intuitive, but to me it is completely counter-intuitive. The function that I'm calling is not changing any of its inputs. Telling me that behind the scenes it calls "plots!" is describing an implementation detail that can change and should have no bearing on the exposed API. Another pertinent example is the write function: write(stream, foo) Using your line of reasoning you'd say that "write()" is modifying "stream" and therefore should have an exclamation mark. But this is clearly not how the Julia convention works. The fact that "stream" points to something that was modified is not enough to merit the exclamation mark. I would argue that "plots(plt, ...)" is like "write(stream, ...)" Cheers, Daniel.
