Ralf Hemmecke wrote: > > > [[x, y, z] for t in allTriples > > | (x := t(1))^3 + (y := t(2))^3 = (z := t(3))^3] > > > > If allTriples goes without repetitions trough all triples of > > integers this stream is finite, but I do not want to > > exclude such streams. > > Well, the dangerous thing with the above stream is that (if there are > just N entries in this stream) you shouldn't ask for an element that > comes after the last one (i.e. wanting to access the (N+1)-th element, > will never succeed). > > Honestly, I wouldn't suddently want to run into a never returning > function call. In other words, without otherwise ensuring that only > computable stream elements are accessed, I wouldn't want to see such > stream, no matter how nice they look.
The point is that it is programmer job to ensure that there is enough values. I do not expect compiler to try to prove that stream is infinite and reject the ones for which it can not decide. Also, note that there is kind of dual to this: reasonable streams which sometimes are finite and you can easily detect finiteness: consider nonzero Taylor coefficients of a rational function with on pole at 0. If this function happens to be a polynomial (which is easy to check), then we get finite stream, otherwise infinite. Do you want to throw errors when such function is given a polynomial? -- Waldek Hebisch hebi...@math.uni.wroc.pl -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To post to this group, send email to fricas-devel@googlegroups.com. To unsubscribe from this group, send email to fricas-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fricas-devel?hl=en.