Main > Free Download Search >

Free scalar properties 0.12 software for linux

scalar properties 0.12

Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 1130
Scalar::Properties 0.12

Scalar::Properties 0.12


Scalar::Properties is a Perl module package that contains run-time properties on scalar variables. more>>
Scalar::Properties is a Perl module package that contains run-time properties on scalar variables.

SYNOPSIS

use Scalar::Properties;
my $val = 0->true;
if ($val && $val == 0) {
print "yup, its true alright...n";
}

my @text = (
hello world->greeting(1),
forget it,
hi there->greeting(1),
);
print grep { $_->is_greeting } @text;

my $l = hello world->length;

Scalar::Properties attempts to make Perl more object-oriented by taking an idea from Ruby: Everything you manipulate is an object, and the results of those manipulations are objects themselves.

hello world->length
(-1234)->abs
"oh my god, its full of properties"->index(g)

The first example asks a string to calculate its length. The second example asks a number to calculate its absolute value. And the third example asks a string to find the index of the letter g.

Using this module you can have run-time properties on initialized scalar variables and literal values. The word properties is used in the Perl 6 sense: out-of-band data, little sticky notes that are attached to the value. While attributes (as in Perl 5s attribute pragma, and see the Attribute::* family of modules) are handled at compile-time, properties are handled at run-time.
Internally properties are implemented by making their values into objects with overloaded operators. The actual properties are then simply hash entries.
Most properties are simply notes you attach to the value, but some may have deeper meaning. For example, the true and false properties plays a role in boolean context, as the first example of the Synopsis shows.

Properties can also be propagated between values. For details, see the EXPORTS section below. Here is an example why this might be desirable:

pass_on(approximate);
my $pi = 3->approximate(1);
my $circ = 2 * $rad * $pi;

# now $circ->approximate indicates that this value was derived
# from approximate values

Please dont use properties whose name start with an underscore; these are reserved for internal use.

You can set and query properties like this:

$var->myprop(1)

sets the property to a true value.

$var->myprop(0)

sets the property to a false value. Note that this doesnt delete the property (to do so, use the del_props method described below).

$var->is_myprop, $var->has_myprop

returns a true value if the property is set (i.e., defined and has a true value). The two alternate interfaces are provided to make querying attributes sound more natural. For example:

$foo->is_approximate;
$bar->has_history;

<<less
Download (0.010MB)
Added: 2007-05-21 License: Perl Artistic License Price:
886 downloads
Java Properties 0.8.3

Java Properties 0.8.3


Java Properties provides an efficient way to access bean-like properties of Java objects. more>>
Java Properties provides an efficient way to access bean-like properties of Java objects.

In a nutshell, provides an efficient way to access bean-like properties of java objects. Unlike java bean properties, a chain of properties can be specified efficiently, allowing convenient access to properties of nested domain objects.

Runtime class-generation and caching can be used very easily to obviate the need for reflection, without losing the flexibility it provides.

Class Properties It also provides classes which manipulate objects at runtime by using strings to address conceptual variables (think bean properties) in a similar fashion to the java reflection mechanisms.

Class Property example Say we have the following classes:

public class Order {
...
public Customer getCustomer() { ... }
...
}
public class Customer {
...
public Address getAddress() { ... }
...
}
public class Address {
...
public String getLine1() { ... }
public String getLine2() { ... }
...
}

Now, we could do this to access line 1 of the address:

result = order.getCustomer().getAddress().getLine1();

But what if there are nulls? What if we want to compare the first line of the address from two different orders? Whith properties this is really simple:

ClassProperty p = PropertyManager.getProperty(Order.class,"Customer:Address:Line1",true);
result = p.getValue(order);

The idea is simple enough - you use the string "Customer:Address:Line1" to specify a series of getXXX calls. Importantly, it the library handles nulls for you, returning null if any of the objects in the chain are null.

Note, this is not simply a wrapper around java reflection, since it includes non-reflective optimizations by making use of the cojen library to generate class files at runtime to acces these properties.

The real benefit lies in being able to specify which properties you wish to access at runtime. You can even pass this ability on to the users of your library or application. Unlike reflection, class files are generated for the properties, and these files are cached - which means once you have specified a property once, further uses of the same property dont use reflection and are very fast.

Property API vs Java Bean Properties. The property API models accessor/mutator method pairs as conceptual variables called properties. The approach used is similar to, but more flexible than java bean properties, and more performant than reflection if runtime class generation is used. Unlike java bean properties, a chain or path of properties can be specified (and more importantly, turned into bytecode using runtime generation) to traverse a complex tree of objects.
It is simple to create applications portable between different security environments - using runtime generation where allowed, and falling back to reflection where security is tighter.

Dynamic Class Management. The properties package also provides classes to handle the loading (and unloading/reloading) of classes at runtime. It provides a framework useful for dynamically loading runtime-generated classes, for example.
While the property API can happily ignore the dynamic loading framework, it can also make use of it to enable runtime class generation.
<<less
Download (0.017MB)
Added: 2007-01-10 License: GPL (GNU General Public License) Price:
1017 downloads
Symlink Properties Plugin 0.12

Symlink Properties Plugin 0.12


Symlink Properties Plugin is a plugin for Konqueror. more>>
This is a plugin for the Konqueror file manager, which adds an additional tab to the file properties dialogue allowing the destination of a symbolic link to be viewed and changed.
The plugin is released under the GNU General Public Licence, see the file LICENSE within the distribution archive for further information.
The plugin is installed in much the same way as any other KDE or GNU application; you must have the Qt toolkit and KDE 3.1.2 or later already installed, of course. See the INSTALL file for detailed installation instructions. Once the plugin is installed, see the documentation in the KDE Help Centre for more information.
Enhancements:
- Accelerator key "&Symbolic Link" for tab now clashes with "&Share" (KDE 3.3.2).
- Change accelerator to "S&ymbolic Link".
- Fix download URL in documentation.
<<less
Download (0.59MB)
Added: 2005-06-08 License: GPL (GNU General Public License) Price:
1600 downloads
Gnome Splash Properties 0.3.0

Gnome Splash Properties 0.3.0


Gnome Splash Properties lets you easily setup your splash on GNOME desktop. more>>
Gnome Splash Properties lets you easily setup your splash on GNOME desktop.

Written in Ruby and Ruby-Gnome2 "Gnome Splash Properties" aim to by easy too use. In near future Drag & Drop support is planed.

Gentoo ebuild is available on the web site. Installation: run "ruby setup.rb" in the main folder.

<<less
Download (MB)
Added: 2005-11-17 License: GPL (GNU General Public License) Price:
1439 downloads
MMDS::Properties 1.902

MMDS::Properties 1.902


MMDS::Properties Perl module contains flexible properties handling for MMDS. more>>
MMDS::Properties Perl module contains flexible properties handling for MMDS.
use MMDS::Properties;
my $cfg = new MMDS::Properties;
# Preset a property.
$cfg->set_property("config.version", "1.23");
# Parse a properties file.
$cfg->parsefile("config.prp");
# Get a property value
$version = $cfg->get_property("config.version");
# Same, but with a default value.
$version = $cfg->get_property("config.version", "1.23");
# Get the list of subkeys for a property, and process them.
my $aref = $cfg->get_property_keys("item.list");
foreach my $item ( @$aref ) {
if ( $cfg->get_property("item.list.$item") ) {
....
}
}
The property mechanism is modelled after the Java implementation of properties.
In general, a property is a string value that is associated with a key. A key is a series of names (identifiers) separated with periods. Names are treated case insensitive. Unlike in Java, the properties are really hierarchically organized. This means that for a given property you can fetch the list of its subkeys, and so on. Moreover, the list of subkeys is returned in the order the properties were defined.
Property lookup can use a preset property context. If a context ctx has been set using set_context(ctx), get_property(foo.bar) will first try ctx.foo.bar and then foo.bar. get_property(.foo.bar) (note the leading period) will only try ctx.foo.bar and raise an exception if no context was set.
Design goals:
- properties must be hierarchical of unlimited depth;
- manual editing of the property files (hence unambiguous syntax and lay out);
- it must be possible to locate all subkeys of a property in the order they appear in the property file(s);
- lightweight so shell scripts can use it to query properties.
METHODS
new
new is the standard constructor. new doesnt require any arguments, but you can pass it a list of initial properties to store in the resultant properties object.
new
clone is like new, but it takes an existing properties object as its invocant and returns a new object with the contents copied.
WARNING This is not yet a deep copy, so take care.
parsefile file [ , path [ , context ] ]
parsefile reads a properties file and adds the contents to the properties object.
file is the name of the properties file. This file is searched in all elements of path (an array reference) unless the name starts with a slash. Default path is . (current directory).
context can be used to designate an initial context where all properties from the file will be subkeys of.
For the detailed format of properties files see below.
get_property prop [ , default ]
Get the value for a given property prop.
If a context ctx has been set using set_context(ctx), get_property(foo.bar) will first try ctx.foo.bar and then foo.bar. get_property(.foo.bar) (note the leading period) will only try ctx.foo.bar and raise an exception if no context was set.
If no value can be found, default is used.
In either case, the resultant value is examined for references to other properties or environment variables. Such a reference looks like
${name}
${name:default}
name can be the name of an environment variable or property. If name is found in the environment, its value is substituted and the expansion process continues, re-examining the new contents, until no further substitutions can be made. If a non-empty value exists for the property name its value is used in a similar way. Hence an empty value for a property will be ignored. If no value can be found, the default string (not to be confused with the default parameter) will be returned.
As an additional service, a tilde ~ in what looks like a file name will be expanded to ${HOME}.
The method result_in_context can be used to determine how the result was obtained. It will return a non-empty string indicating the context in which the result was found, an emptry string indicating the result was found without context, or undef if no value was found at all.
get_property_noexpand prop [ , default ]
This is like get_property, but does not do any expansion.
gps prop [ , default ]
This is like get_property, but raises an exception if no value could be established.
This is probably the best and safest method to use.
get_property_keys prop
Returns an array reference with the names of the (sub)keys for the given property. The names are unqualified, e.g., when properties foo.bar and foo.blech exist, get_property_keys(foo) would return [bar, blech].
expand value [ , context ]
Perform the expansion as described with get_property.
set_property prop, value
Set the property to the given value.
set_properties prop1 => value1, ...
Add a hash (key/value pairs) of properties to the set of properties.
set_context context
Set the search context. Without argument, clears the current context.
get_context
Get the current search context.
result_in_context
Get the context status of the last search.
Empty means it was found out of context, a string indicates the context in which the result was found, and undef indicates search failure.
dump [ start [ , stream ] ]
Produce a listing of all properties from a given point in the hierarchy and write it to the stream.
stream defaults to *STDOUT.
dumpx [ start [ , stream ] ]
Like dump, but dumps with all values expanded.
<<less
Download (0.40MB)
Added: 2007-06-08 License: Perl Artistic License Price:
870 downloads
Glib Binding Properties 0.9.1

Glib Binding Properties 0.9.1


Glib Binding Properties is a system that allows developers to bind properties of GLib and GTK+ objects. more>>
Glib Binding Properties library adds an implementation of binding properties to GLib / GTK+ library (it also includes Ada 95 for GtkAda GTK bindings, GtkAda was made by ACT corp.)

Binding properties is automatic synchronizing values of several properties to keep their values correspondingly to each other, so that when a property changes properties bound with it automatically change accordingly. Also bindings with value transformation functions are supported.

Binding properties much reduces development time of desktop applications and increases reliability as frees you from time consuming and error-prone writing callback handlers of property changes. (Probably wrong property change handlers is the most often cause of errors in GUI applications!)

Current version 0.9.1 is an alpha version. Please test it.
<<less
Download (0.32MB)
Added: 2006-03-24 License: LGPL (GNU Lesser General Public License) Price:
1310 downloads
Config::Properties 0.65

Config::Properties 0.65


Config::Properties is a Perl module to read and write property files. more>>
Config::Properties is a Perl module to read and write property files.

SYNOPSIS

use Config::Properties;

# reading...

open PROPS, "< my_config.props"
or die "unable to open configuration file";

my $properties = new Config::Properties();
$properties->load(*PROPS);

$value = $properties->getProperty( $key );


# saving...

open PROPS, "> my_config.props"
or die "unable to open configuration file for writing";

$properties->setProperty( $key, $value );

$properties->format( %s => %s );
$properties->store(*PROPS, $header );

Config::Properties is a near implementation of the java.util.Properties API. It is designed to allow easy reading, writing and manipulation of Java-style property files.

The format of a Java-style property file is that of a key-value pair seperated by either whitespace, the colon (:) character, or the equals (=) character. Whitespace before the key and on either side of the seperator is ignored.
Lines that begin with either a hash (#) or a bang (!) are considered comment lines and ignored.

A backslash () at the end of a line signifies a continuation and the next line is counted as part of the current line (minus the backslash, any whitespace after the backslash, the line break, and any whitespace at the beginning of the next line).

The official references used to determine this format can be found in the Java API docs for java.util.Properties at http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html.
When a property file is saved it is in the format "key=value" for each line. This can be changed by setting the format attribute using either $object->format( $format_string ) or $object->setFormat( $format_string ) (they do the same thing). The format string is fed to printf and must contain exactly two %s format characters. The first will be replaced with the key of the property and the second with the value. The string can contain no other printf control characters, but can be anything else. A newline will be automatically added to the end of the string. You an get the current format string either by using $object->format() (with no arguments) or $object->getFormat().

If a recent version of module Text::Wrap is available, long lines are conveniently wrapped when saving.

<<less
Download (0.011MB)
Added: 2007-04-12 License: Perl Artistic License Price:
928 downloads
App::Serializer::Properties 0.965

App::Serializer::Properties 0.965


App::Serializer::Properties is a Perl interface for serialization and deserialization. more>>
App::Serializer::Properties is a Perl interface for serialization and deserialization.

SYNOPSIS

use App;

$context = App->context();
$serializer = $context->service("Serializer"); # or ...
$serializer = $context->serializer();
$data = {
an => arbitrary,
collection => [ of, data, ],
of => {
arbitrary => depth,
},
};
$propdata = $serializer->serialize($data);
$data = $serializer->deserialize($propdata);
print $serializer->dump($data), "n";

<<less
Download (0.12MB)
Added: 2007-06-21 License: Perl Artistic License Price:
856 downloads
WWW::Webrobot::Properties 0.81

WWW::Webrobot::Properties 0.81


WWW::Webrobot::Properties is a Perl module that implements a config format like java.util.Properties. more>>
WWW::Webrobot::Properties is a Perl module that implements a config format like java.util.Properties.

SYNOPSIS

my $config = WWW::Webrobot::Properties->new(
listmode => [qw(names auth_basic output http_header proxy no_proxy)],
key_value => [qw(names http_header proxy)],
multi_value => [qw(auth_basic)],
structurize => [qw(load mail)],
);
my $cfg = $config->load_file($cfg_name, $cmd_param);

This class implements a config format like java.util.Properties, see http://java.sun.com/j2se/1.3/docs/api/java/util/Properties.html for more docs.
Note: Some features are not implemented but there are some extensions for lists.

EXTENDED FORMAT

Listmode properties may be written

listprop=value0
listprop=value1
listprop=value2

or

listprop.0=value0
listprop.1=value1
listprop.2=value2

These properties are made available as perl-arrays.

<<less
Download (0.097MB)
Added: 2007-06-15 License: Perl Artistic License Price:
862 downloads
X Window Properties Viewer 0.2

X Window Properties Viewer 0.2


X Window Properties Viewer allows you to select a X window and view/edit its properties. more>>
X Window Properties Viewer project allows you to select a X window and view/edit its properties.

A tree viewer lets to see part or all of the windows tree on your X server.

After selecting a window you can view all of the resources at once or select individual ones for viewing/editing.

Only editing strings is currently supported.

<<less
Download (0.050MB)
Added: 2006-09-30 License: Free To Use But Restricted Price:
1122 downloads
Scalar::Number 0.001

Scalar::Number 0.001


Scalar::Number is a Perl module with numeric aspects of scalars. more>>
Scalar::Number is a Perl module with numeric aspects of scalars.

SYNOPSIS

use Scalar::Number qw(scalar_num_part);

$num = scalar_num_part($scalar);

use Scalar::Number qw(sclnum_is_natint sclnum_is_float);

if(sclnum_is_natint($value)) { ...
if(sclnum_is_float($value)) { ...

use Scalar::Number qw(sclnum_val_cmp sclnum_id_cmp);

@sorted_nums = sort { sclnum_val_cmp($a, $b) } @floats;
@sorted_nums = sort { sclnum_id_cmp($a, $b) } @floats;

This module is about the numeric part of plain (string) Perl scalars. A scalar has a numeric value, which may be expressed in either the native integer type or the native floating point type. Many values are expressible both ways, in which case the exact representation is insignificant. To fully understand Perl arithmetic it is necessary to know about both of these representations, and the differing behaviours of numbers according to which way they are expressible.
This module provides functions to extract the numeric part of a scalar, classify a number by expressibility, and compare numbers across representations.

<<less
Download (0.009MB)
Added: 2007-05-21 License: Perl Artistic License Price:
886 downloads
Scalar::Footnote 0.99_02

Scalar::Footnote 0.99_02


Scalar::Footnote is a Perl module that can attach hidden scalars to references. more>>
Scalar::Footnote is a Perl module that can attach hidden scalars to references.

SYNOPSIS

use Data::Dumper;
use Scalar::Footnote;

my $obj = Foo->new;

# attach invisible footnote to $obj:
$obj->Scalar::Footnote::set( my_key => my footnote );
print Dumper( $obj );

# get it back:
my $note = $obj->Scalar::Footnote::get( my_key );
print "footnote: $noten";

# remove it:
my $note = $obj->Scalar::Footnote::remove( my_key );

Scalar::Footnote lets you attach scalar footnotes to an object (or any kind of reference, really) that are essentially invisible from Perl. For example, if you try dumping an object that has a footnote attached to it, you wont actually see the footnote:

my $obj = bless [qw( foo bar )], Foo;
$obj->Scalar::Footnote::set( Foo => foo note );
print Dumper( $obj );
prints:
$VAR1 = bless [
foo,
bar
], Foo;

You can of course still access the footnote with Scalar::Footnote::get.

<<less
Download (0.009MB)
Added: 2007-05-21 License: Perl Artistic License Price:
889 downloads
Framework for Contact properties 0.1.2

Framework for Contact properties 0.1.2


Framework for Contact properties offers quick access to your contacts and also view their status. more>>
Framework for Contact properties offers quick access to your contacts and also view their status.
Short version:
Want quick access to your contacts, or see what their status is? Here you go: Have contact cards floating on the desktop, or list them on Kicker, so things like chatting or emailing to them is only one/two mouse clicks away. Or drop them a file/url!
Long version:
A framework for contacts and services upon them. It consists of two libs, libcontactpropertiescore and libcontactpropertiesgui.
The tarball has additionally some useful examples for services and two applications, a contact cards server and a kicker applet, based on the Contacts menu for kicker.
No translations available.
Please see http://frinring.wordpress.com/2006/07/05/framework-for-contacts-and-services-slowly-getting-shapes/
Then try it and create some own services, to be able to give feedback on the framework(!)
To have your property and services loaded, add a file named "contactpropertiesrc" to "$HOME/.kde/share/config" with this content:
[General]
Properties=birthday,imaddress,emailaddress,homepageurl,phonenumber,address,note,shellname,yourtype
[Property:yourtype]
ActionServices=youraction,youraction2
DefaultActionServices=youraction,youraction2
DataActionServices=yourdataaction,yourdataaction2
DefaultDataActionServices=yourdataaction2,yourdataaction2
StatusServices=yourstatus, yourstatus2
with "your*" adopted to your property and the optional services...
Enhancements:
- applet: sorting of contact lists can be configured
<<less
Download (0.55MB)
Added: 2006-12-23 License: GPL (GNU General Public License) Price:
1035 downloads
Scalar::Util 1.19

Scalar::Util 1.19


Scalar::Util is a selection of general-utility scalar subroutines. more>>
Scalar::Util is a selection of general-utility scalar subroutines.

SYNOPSIS

use Scalar::Util qw(blessed dualvar isweak readonly refaddr reftype tainted
weaken isvstring looks_like_number set_prototype);

Scalar::Util contains a selection of subroutines that people have expressed would be nice to have in the perl core, but the usage would not really be high enough to warrant the use of a keyword, and the size so small such that being individual extensions would be wasteful.

By default Scalar::Util does not export any subroutines. The subroutines defined are

blessed EXPR

If EXPR evaluates to a blessed reference the name of the package that it is blessed into is returned. Otherwise undef is returned.

$scalar = "foo";
$class = blessed $scalar; # undef

$ref = [];
$class = blessed $ref; # undef

$obj = bless [], "Foo";
$class = blessed $obj; # "Foo"

dualvar NUM, STRING

Returns a scalar that has the value NUM in a numeric context and the value STRING in a string context.

$foo = dualvar 10, "Hello";
$num = $foo + 2; # 12
$str = $foo . " world"; # Hello world

isvstring EXPR

If EXPR is a scalar which was coded as a vstring the result is true.

$vs = v49.46.48;
$fmt = isvstring($vs) ? "%vd" : "%s"; #true
printf($fmt,$vs);

isweak EXPR

If EXPR is a scalar which is a weak reference the result is true.

$ref = $foo;
$weak = isweak($ref); # false
weaken($ref);
$weak = isweak($ref); # true

NOTE: Copying a weak reference creates a normal, strong, reference.

$copy = $ref;
$weak = isweak($ref); # false

looks_like_number EXPR

Returns true if perl thinks EXPR is a number. See "looks_like_number" in perlapi.

openhandle FH

Returns FH if FH may be used as a filehandle and is open, or FH is a tied handle. Otherwise undef is returned.

$fh = openhandle(*STDIN); # *STDIN
$fh = openhandle(*STDIN); # *STDIN
$fh = openhandle(*NOTOPEN); # undef
$fh = openhandle("scalar"); # undef

readonly SCALAR

Returns true if SCALAR is readonly.

sub foo { readonly($_[0]) }

$readonly = foo($bar); # false
$readonly = foo(0); # true

refaddr EXPR

If EXPR evaluates to a reference the internal memory address of the referenced value is returned. Otherwise undef is returned.

$addr = refaddr "string"; # undef
$addr = refaddr $var; # eg 12345678
$addr = refaddr []; # eg 23456784

$obj = bless {}, "Foo";
$addr = refaddr $obj; # eg 88123488

reftype EXPR

If EXPR evaluates to a reference the type of the variable referenced is returned. Otherwise undef is returned.

$type = reftype "string"; # undef
$type = reftype $var; # SCALAR
$type = reftype []; # ARRAY

$obj = bless {}, "Foo";
$type = reftype $obj; # HASH

set_prototype CODEREF, PROTOTYPE

Sets the prototype of the given function, or deletes it if PROTOTYPE is undef. Returns the CODEREF.

set_prototype &foo, $$;

tainted EXPR

Return true if the result of EXPR is tainted

$taint = tainted("constant"); # false
$taint = tainted($ENV{PWD}); # true if running under -T

weaken REF

REF will be turned into a weak reference. This means that it will not hold a reference count on the object it references. Also when the reference count on that object reaches zero, REF will be set to undef.

This is useful for keeping copies of references , but you dont want to prevent the object being DESTROY-ed at its usual time.

{
my $var;
$ref = $var;
weaken($ref); # Make $ref a weak reference
}
# $ref is now undef

Note that if you take a copy of a scalar with a weakened reference, the copy will be a strong reference.

my $var;
my $foo = $var;
weaken($foo); # Make $foo a weak reference
my $bar = $foo; # $bar is now a strong reference

This may be less obvious in other situations, such as grep(), for instance when grepping through a list of weakened references to objects that may have been destroyed already:

@object = grep { defined } @object;

This will indeed remove all references to destroyed objects, but the remaining references to objects will be strong, causing the remaining objects to never be destroyed because there is now always a strong reference to them in the @object array.

<<less
Download (0.042MB)
Added: 2007-05-21 License: Perl Artistic License Price:
888 downloads
Scalar::Defer 0.07

Scalar::Defer 0.07


Scalar::Defer is a Perl module to calculate values on demand. more>>
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.

<<less
Download (0.025MB)
Added: 2006-10-18 License: MIT/X Consortium License Price:
1101 downloads
Secleted [ 0 ] software to compare
  • Page: 1 of 5
  • 1
  • 2
  • 3
  • 4
  • 5