⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.93
Server IP:
65.108.141.171
Server:
Linux server.heloix.com 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
ri
/
2.7.0
/
system
/
Enumerable
/
View File Name :
lazy-i.ri
U:RDoc::AnyMethod[iI" lazy:ETI"Enumerable#lazy;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"BReturns an Enumerator::Lazy, which redefines most Enumerable ;TI"Emethods to postpone enumeration and enumerate values only on an ;TI"as-needed basis.;To:RDoc::Markup::BlankLine S:RDoc::Markup::Heading: leveli: textI"Example;T@o; ; [I"5The following program finds pythagorean triples:;T@o:RDoc::Markup::Verbatim; [I"def pythagorean_triples ;TI"/ (1..Float::INFINITY).lazy.flat_map {|z| ;TI" (1..z).flat_map {|x| ;TI" (x..z).select {|y| ;TI"! x**2 + y**2 == z**2 ;TI" }.map {|y| ;TI" [x, y, z] ;TI" } ;TI" } ;TI" } ;TI" end ;TI"*# show first ten pythagorean triples ;TI"Mp pythagorean_triples.take(10).force # take is lazy, so force is needed ;TI";p pythagorean_triples.first(10) # first is eager ;TI".# show pythagorean triples less than 100 ;TI">p pythagorean_triples.take_while { |*, z| z < 100 }.force;T:@format0: @fileI"enumerator.c;T:0@omit_headings_from_table_of_contents_below0I"e.lazy -> lazy_enumerator ;T0[ I"();T@(FI"Enumerable;TcRDoc::NormalModule00