naively implement nqp::replace