> I was trying to add a bunch of common functions to DistributedArrays.jl with > the below code block > > for f in [:sum, :minimum, :maximum, :mean] > @eval begin > import Base: ($f) > export ($f) > function ($f)(D::DArray) > refs = [@spawnat p ($f)(localpart(D)) for p in procs(D)] > ($f)([fetch(r) for r in refs]) > end > end > end
At least instead of the import you can write Base.$f. The export might work in a macro?
