[[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.

But if you add a restriction like

for t in allTriples while size(t)<10000 | ...

then you basically ensure finiteness and we are back at the distiction of LazyList vs. infinite Stream.

Ralf

--
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.

Reply via email to