On Wednesday, April 13, 2016 at 6:14:29 AM UTC+3, Steven G. Johnson wrote:
> You don't need an explicit userdata argument -- this is just a crude > simulation of closures in C, but Julia has true closures and lexical > scoping. > > For example > > > myvar = 7 > Vegas( (x,f) -> f[1] = log(x[1] + myvar)/sqrt(x[1]), 1, 1) > > > will "capture" the value of myvar and pass it through Vegas to the > integrand, via the closure. > Ah, of course. Some Julia magic :-). Thanks! Kaj
