reimplemented misc.jl stuff, promotion rules between arrays and diracarrays