Lazily evaluate items in a list

AUTHOR

Scott Penrose

#!/usr/bin/env perl6

use v6;



my @fibonacci = 1, 1, { $^a + $^b } ... *;
say @fibonacci[6];     # 13

# vim: expandtab shiftwidth=4 ft=perl6

See Also

01-read-from-file.raku

Reading from a file

01-read-from-terminal.raku

Reading from the terminal

01-word-wrap.raku

Word-wrap paragraphs to a given length

01-write-to-file.raku

Write to a file

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.

Built with Podlite β€” the markup and publishing tools behind this site.