README.md

Attribute::Lazy

Synopsis

useAttribute::Lazy;
classFoo {
has $.foo willlazy { "zub" };
}

Description

This is based on an experimental trait that was briefly in the Rakudo core.

Attribute::Lazy provides a single traitwill lazy that will allow
an attribute with a public accessor (that is one defined with the "." twigil,)
to be initialised the first time it is accessed by the result of the supplied
block. This might be useful if the value may not be used and may be expensive
to calculate (or various other reasons that haven't been thought of.)

Installation

Assuming you have a working Rakudo Perl 6 installation you should be able to
install this with zef :