ApproxFun.jl icon indicating copy to clipboard operation
ApproxFun.jl copied to clipboard

Change a<b, max(a,b) to a.<b, max.(a,b)

Open dlfivefifty opened this issue 7 years ago • 4 comments

The current usage is confusing as you'd expect < to return a Bool. I think overloading .< would be better.

This will have to wait til 0.4 support is dropped

dlfivefifty avatar Dec 02 '16 21:12 dlfivefifty

Hmm, realized a::Fun < b::Fun isn't implemented. This could be defined as 0 < b-a. And then a .< b would return a Fun that is piecewise true/false.

dlfivefifty avatar Dec 02 '16 21:12 dlfivefifty

I think the issue with max(a::Fun,b::Fun) is one would expect it to return either b or a. Where max.(a,b) is clear that you want the pointwise definition

dlfivefifty avatar Dec 02 '16 21:12 dlfivefifty

Oh, but in 0.5 there is still autofusing:

julia> max([1,2,3],[0,5,6])
3-element Array{Int64,1}:
 1
 5
 6

dlfivefifty avatar Dec 02 '16 21:12 dlfivefifty

max([1,2,3],[0,5,6]) now throws a deprecation warning, so I think the same should be true for Funs.

dlfivefifty avatar Aug 24 '17 11:08 dlfivefifty