Closed dmarsh26 closed 10 years ago
LazySeq<T>
doesn't provide collect()
method because it's not a Stream<T>
. However in your case it's not a problem:
s2.stream().collect(Collectors.toList());
//or:
s2.toList();
//and:
s2.stream().collect(Collectors.joining("-"));
Do you have any other issues with this library?
PS: Your code can be simplified slightly:
final Iterator<Character> it = rna.codePoints().mapToObj(x -> (char) x).iterator();
final LazySeq<Character> chars = LazySeq.of(it);
LazySeq<List<Character>> s1 = chars.sliding(3);
LazySeq<String> s2 = s1.map(Chapter2::mapCodon);
Oh I thought it was a type of stream, many thanks ! great library ! :)
Date: Sun, 12 Oct 2014 11:19:32 -0700 From: notifications@github.com To: LazySeq@noreply.github.com CC: dmarsh26@hotmail.com Subject: Re: [LazySeq] Using with character streams... (#7)
LazySeq
s2.stream().collect(Collectors.toList()); //or: s2.toList();
//and: s2.stream().collect(Collectors.joining("-"));
Do you have any other issues with this library?
PS: Your code can be simplified slightly:
final Iterator
— Reply to this email directly or view it on GitHub. =
Thanks, feel free to bring more question or bugs here.
I'm having trouble getting the LazySeq to work, maybe you could help ?
many thanks
package chapter2;
import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.stream.Collectors;
import com.nurkiewicz.lazyseq.LazySeq;
public class Chapter2 {
}