samth
2022-1-24 14:04:32

If this is about the issue with factorize, I think a dynamic error is probably preferable, because most people’s code won’t do thay dynamically but changing the type might break code that never used it in a weird way


pavpanchekha
2022-1-24 16:15:19

Got it, it was


pavpanchekha
2022-1-24 16:15:35

Even a dynamic error is an incompatibility, though—you think this one is worth breaking?


samth
2022-1-24 16:16:01

Is just changing it to the right answer a possibility?


samth
2022-1-24 16:16:18

That is of course also incompatible in some sense, but it seems much less bad.


pavpanchekha
2022-1-24 16:59:22

Well, the thing is that there’s not a clear “right answer” here.


pavpanchekha
2022-1-24 16:59:49

The “best answer” I could imagine is having (factorize 0) return '((0 1)) in other words to have 0 factorize as 0^1


pavpanchekha
2022-1-24 17:00:07

But this would break a different plausible invariant, which is that the first element of each pair is a prime.


pavpanchekha
2022-1-24 17:00:49

In other words, the issue is that there isn’t an unambiguous right answer. Raising an error (or even better having a type check) is a good escape in this situation


pavpanchekha
2022-1-24 17:01:02

But it is of course not backwards compatible


pavpanchekha
2022-1-24 17:01:33

Runtime error seems best to me, but if we prioritize strict b.c. we could produce a warning this release and error next release, or similar


soegaard2
2022-1-24 21:29:36

This sounds as a good solution (the runtime error that is).


soegaard2
2022-1-24 21:31:18

The documentation reads:


soegaard2
2022-1-24 21:35:40

I think the choice was made to make easier to use in context with the other number theoretic functions - but I am not 100% sure.


notjack
2022-1-25 02:08:15

Runtime error sounds right to me too