Spent an hour looking for a bug, which turned out to be coming from a line of the form
where A::Vector{ZZRingElem}. This will call zero(parent(A)), which surprisingly does not fail, since parent(A) === A, and then it calls map(zero, A).
Are there objections to doing something of the form
function zero!(A::Vector{T}) where {T <: RingElement}
for i in 1:length(A)
A[i] = zero!(A[i])
end
return A
end
?
Spent an hour looking for a bug, which turned out to be coming from a line of the form
where
A::Vector{ZZRingElem}. This will callzero(parent(A)), which surprisingly does not fail, sinceparent(A) === A, and then it callsmap(zero, A).Are there objections to doing something of the form
?