On Sep 19, 2015, at 6:28 AM, Lee Streeter <[email protected]> wrote: > > > Hello there > > I'm a long time Matlab user and I'm loving using Julia. > > Is there a simple way to string together anonymous functions built from > closures? What I mean is say I have a function > > g = function(a,b) > f=function (x) > 'some code that returns numerical output based on inputs a and b' > end > end > > I would like to form > y = g(a1,b1) + g(a2,b2) > so I can call > y(x_numerical_value) >
It’s a little unclear to me exactly what behavior you want from y. 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) ?
