Main > Programming > Libraries >

Scalar::Defer 0.07

Scalar::Defer 0.07

Sponsored Links

Scalar::Defer 0.07 Ranking & Summary

RankingClick at the star to rank
Ranking Level
User Review: 0 (0 times)
File size: 0.025 MB
Platform: Any Platform
License: MIT/X Consortium License
Price:
Downloads: 1101
Date added: 2006-10-18
Publisher: Audrey Tang

Scalar::Defer 0.07 description

Scalar::Defer is a Perl module to calculate values on demand.

SYNOPSIS

use Scalar::Defer; # exports defer and lazy

my ($x, $y);
my $dv = defer { ++$x }; # a deferred value (not memoized)
my $lv = lazy { ++$y }; # a lazy value (memoized)

print "$dv $dv $dv"; # 1 2 3
print "$lv $lv $lv"; # 1 1 1

my $forced = force $dv; # force a normal value out of $dv

print "$forced $forced $forced"; # 4 4 4

This module exports two functions, defer and lazy, for building values that are evaluated on demand. It also exports a force function to force evaluation of a deferred value.

defer {...}

Takes a block or a code reference, and returns a deferred value. Each time that value is demanded, the block is evaluated again to yield a fresh result.

lazy {...}

Like defer, except the value is computed at most once. Subsequent evaluation will simply use the cached result.

force $value

Force evaluation of a deferred value to return a normal value. If $value was already normal value, then force simply returns it.

NOTES

Deferred values are not considered objects (ref on them returns 0), although you can still call methods on them, in which case the invocant is always the forced value.

Unlike the tie-based Data::Lazy, this module operates on values, not variables. Therefore, assigning into $dv and $lv above will simply replace the value, instead of triggering a STORE method call.

Also, thanks to the overload-based implementation, this module is about 2x faster than Data::Lazy.

Scalar::Defer 0.07 Screenshot

Advertisements

Scalar::Defer 0.07 Keywords

Bookmark Scalar::Defer 0.07

Hyperlink code:
Link for forum:

Scalar::Defer 0.07 Copyright

WareSeeker periodically updates pricing and software information of Scalar::Defer 0.07 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Scalar::Defer 0.07 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed

Allok Video Splitter 2.2.0 Review:

Name (Required)
Email(Required)
Captcha
Featured Software

Want to place your software product here?
Please contact us for consideration.

Contact WareSeeker.com
Related Software
Scalar::Number is a Perl module with numeric aspects of scalars. Free Download
Scalar::Footnote is a Perl module that can attach hidden scalars to references. Free Download
Scalar::MultiValue is a Perl module to create a SCALAR with multiple values. Free Download
Scalar::Properties is a Perl module package that contains run-time properties on scalar variables. Free Download
Set::Scalar Perl module contains a basic set of operations. Free Download
HTML::BBReverse is a Perl module to convert HTML to BBCode and back. Free Download
Class::DataStore is a Perl module for generic OO data storage/retrieval. Free Download
Tk::SlideShow is a Tk Perl module for building slide-like presentations. Free Download