Iterator :: Simple. ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- Perl Artistic License
- °Ô½ÃÀÚ À̸§:
- Rintaro Ishizaki
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~rintaro/
Iterator :: Simple. ű×
Iterator :: Simple. ¼³¸í
°£´ÜÇÑ ¹Ýº¹ÀÚ ¹× À¯Æ¿¸®Æ¼ Iterator :: SimpleÀº ¹ü¿ë ¹Ýº¹ÀÚ À¯Æ¿¸®Æ¼¸¦ Á¦°øÇÏ´Â Perl ¸ðµâÀÔ´Ï´Ù. ±×·¡µµ °£´ÜÇÏÁö¸¸ °·ÂÇÏ°í ºü¸¥ iterator.Synopsis »ç¿ë Iterator :: Simple; ÇÏÀ§ foo {my $ max = shift; ³» $ i = 0; iterator {$ i> $ max ÀÎ °æ¿ì ¹Ýȯ; $ i ++; }} My $ Iterator = Foo (20); # 0,1,2, ..., 19, 20; $ iterator = IMAP {$ _ + 2} $ iterator; # 8, 3,4,5, ..., 20,21,22 $ ITerator = IGREP {$ _ % 2} $ iterator; # 8,5,7,9, ..., 17,19,21 # iterable °´Ã¼ $ iterator = iter (); # iterator array ref $ iterator = iter (io :: file-> new ($ filename)); # iterator from glob # ÇÊÅÍ $ iterator = ICHAIN ($ ITR1, $ ITR2); # üÀÎ ¹Ýº¹ÀÚ; $ iterator = izip ($ itr1, $ itr2); # zip ¹Ýº¹ÀÚ; $ ITerator = IEnumerate $ iterator; # »öÀÎ Ãß°¡; # ÀÏ¹Ý ÇÊÅÍ $ iterator = ifilter $ iterator, sub {$ _ $ _ if / ^ a /; ¹ÝÇ°; } # (Á¤ÀÇ ($ _ = $ ITerator -> ())) {Àμâ; } (Á¤ÀÇ ($ _ = $ ITerator-> ´ÙÀ½)) {Àμâ; } () {Àμâ; } ¿ä±¸ »çÇ× : ¡¤ Perl.
Iterator :: Simple. °ü·Ã ¼ÒÇÁÆ®¿þ¾î