Very Great work !
However i’am not so fond of solutions that shake the runtime at a too low level with some kind of magical macro on a general basis.
So i have handcoded my yield
struct PSerie
p
end
function Base.iterate(ps::PSerie, itr=(0,1,0))
s,n,y = itr
if y == 1; @goto y1 end
while true
s += 1.0/(n^ps.p)
return s,(s,n,1)
@label y1
n += 1
end
end
And you can too
More info here: