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

Remove `Fun(exp)` convenience constructor?

Open dlfivefifty opened this issue 6 years ago • 0 comments

f = Fun(exp) and x = Fun() is a very convenient as a debug tool, but the semantics are pretty horrible: why would asking to create a Fun to represent exp(x) assume that the domain is -1 .. 1?

A case could be made that the user should always specify the domain. Or rather,

domain(f::Function) = error("Domain cannot be inferred for $(typeof(f))")
Fun(f::Function) = Fun(f, domain(f))

dlfivefifty avatar Sep 08 '17 13:09 dlfivefifty