클래스 HyperSeq
클래스 HyperSeq (HyperSeq) (raku-type-hyperseq)
Seq에 hyper를 호출하면 만들어지는 중간 객체가 HyperSeq예요. 일반적으로 개발자가 직접 쓸 일은 없도록 설계돼 있어요.
class HyperSeq does Iterable does Sequence { }
method iterator
method iterator(HyperSeq:D: --> Iterator:D)
내부의 iterator를 돌려줘요.
method grep
method grep(HyperSeq:D: $matcher, *%options)
Seq에서 하듯이 grep을 HyperSeq에 적용해요.
my @hyped = (^10000).map(*²).hyper;
@hyped.grep( * %% 3 ).say;
# OUTPUT: «(0 9 36 81 144 ...)»
Seq에 hyper를 쓸 때 실제로 호출되는 메서드가 바로 이거예요.
method map
method map(HyperSeq:D: $matcher, *%options)
HyperSeq에 map을 적용해요. 보통 이미 있는 Seq에 hyper를 적용해서 만들어진 객체에서 쓰죠.
method invert
method invert(HyperSeq:D:)
.hyper로 Seq에서 만든 HyperSeq를 뒤집어요(invert).
method hyper
method hyper(HyperSeq:D:)
객체 자신을 돌려줘요.
method race
method race(HyperSeq:D:)
현재 객체에서 RaceSeq 객체를 만들어요.
method serial
multi method serial(HyperSeq:D:)
객체를 Seq로 변환해서 돌려줘요.
method is-lazy
method is-lazy(--> False )
False를 돌려줘요.
method sink
method sink(--> Nil)
기본 데이터 구조를 sink시켜 부수 효과들을 일으켜요.