This is very nearly exactly what I was looking for and works how I wanted. Thanks for the input all.
I'm used to using maxima (the CAS) which doesn't perform numerical computation until every variable necessary is present (and sometimes not even then). This means that you can perform arithmetic on functions together like any other expression. Thanks for pointing out the distinction between generic and anonymous functions. Again, I'm used to maxima where that doesn't appear to be an issue. I'm still having issues with Juno on my Mac however. Where should I be asking questions about that? Thanks again. Lee On Sunday, 20 September 2015 11:44:41 UTC+12, Eric Forgy wrote: > > PS: Here is a simple working example based on the above: > > julia> function g(a,b) > x -> 3*a*b*x > end > g (generic function with 1 method) > > julia> y(x) = g(1,2)(x) + g(2,3)(x) > y (generic function with 1 method) > > julia> y(1) > 24 > > julia> y(2) > 48 > > > On Sunday, September 20, 2015 at 7:40:48 AM UTC+8, Eric Forgy wrote: >> >> Maybe you’re looking to define a new function y (assuming a1, a2, b1, and >>> b2 have already been defined): >>> >>> y(x) = g(a1, b1)(x) + g(a2, b2)(x) >>> >>> ? >>> >> >> I had to try it. The fact this works is very cool. Thanks! >> >> Any performance concerns when doing things like this? >> >
