Hi, I have two Stream of integers, called s1 and s2. I want to add their corresponding elements to form a new stream called s. I use map(f,x,y) to do this, but the result is unexpected if s1 is actually a finite stream, i.e.
(1) -> s1 := [i for i in 1..3] :: Stream INT (1) [1,2,3] Type: Stream(Integer) (2) -> s2 := [j for j in 1..] :: Stream INT (2) [1,2,3,4,5,6,7,8,9,10,...] Type: Stream(Integer) (3) -> map(+, s1, s2) (3) [2,4,6] Type: Stream(Integer) But I want the result : [2,4,6,4,5,6,7,8,9,10,...]. Is there any simple way to do this? Do I have to append s1 to a infinite stream by letting the rest elements all be 0 manually? PS: In the beginning I thought it was a bug. But after checking the description of map(f,x,y), it became quite understandable. As it is impossible to determine what the rest elements should be if stream x has only finite many elements. Thanks in advance! -- Best Regards, Xiaojun Liu @ CAU Sent with Sparrow (http://www.sparrowmailapp.com) -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/fricas-devel?hl=en.
