Ralf Hemmecke wrote: > > Waldek, > > > The tricky case if you do not know if stream is finite. > > If one doesn't know that the stream is finite, it makes no sense to > complete the stream. > > BUT, applying the map function to a known-finite stream could return a > known-finite stream even without evaluating any element of the stream.
Well, as I wrote in other message "known-finite" = "completly evaluated" So the above is impossible. > The problem, however, seems to be the current data structure. Or rather > how "concat" and "delay" create the stream. For this special case one > would have to do it in another way, so we "could" return "true" for > Liu's case. The problem is that there are no marker signaling "this stream is finite", one have to traverse the stream up to the end. Once you get to unevaluated elements 'possiblyInfinite? returns true and 'explicitlyFinite?' returns false. You can not do better without evaluationg elements or storing extra information attached to stream. You seen to agree with me that eagerly evaluating elements is undesirable. IMO storing extra information is also out of question, because parts of streams are heavily shared. Attaching info to say start of stream in interesting situations would attach it to almost all elements, effectively doubling storage use by the stream. -- 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.