I'd agree that it is a bug, yes. Well, the reason why it happens might be justified, but this is probably one of the fattest traps I've seen so far. I really think we should come up with a way to eliminate this trap somehow. Not sure how, but there must be a way and I really recommend anybody reading this to think in this direction (instead of writing a lot of text to come up with excuses to reject this ticket). Maybe it's something we can fix in v6.d, or maybe we can add some kind of warning right now. I don't know, but I truly hope that there is a solution.
On 2017-07-01 13:17:58, pe...@mscha.org wrote: > That may indeed explain why it works the way it does, but that doesn't > mean it isn't a bug. IMO it certainly is; [X] and [X*] don't work as > advertised. > > Let me explain how I found this bug. > I'm generating a list of divisors for a number. I already have the > prime factorization of that number, and a list of all the "prime powers". > Examples: > 24 = 2³×3¹: ((1, 2, 4, 8), (1, 3)) > 42 = 2¹×3¹×7: ((1, 2), (1, 3), (1, 7)) > 64 = 2⁶: ((1, 2, 4, 8, 16, 32, 64),) > Now it's easy to generate the divisors: > > > say [X*] ((1, 2, 4, 8), (1, 3)); > (1 3 2 6 4 12 8 24) > > > say [X*] ((1, 2), (1, 3), (1, 7)); > (1 7 3 21 2 14 6 42) > > > say [X*] ((1, 2, 4, 8, 16, 32, 64),) > (2097152) > Oops...