NAME

Weed - Don't use it. It's in development. For test purposes only!

CAVEATS

Don't use it. It's in development. For test purposes only!

SYNOPSIS

use Weed;

DESCRIPTION

Importing Weed overloads CORE::time with Time::Hires::time. All possible restrictions and all possible warnings are enabled.

EXPORTS

NO

Is not YES.

YES

Is not NO.

ENVIRONMENT

Type list ...

TYPE CREATION

SYNOPSIS

package BasePackage;

use Weed 'Object';

use Weed 'Scalar ()';
use Weed 'Array []';
use Weed 'Hash {}';

use Weed 'Type : Supertype {}';
use Weed 'Type : Supertype Supertypes {}';

Creates a new type in each case and binds this to the base package.

sub new { shift->NEW }

my $object = new Type;

FUNCTION IMPORT

In some cases you need a function directly in your type.

package BasePackage;

use Weed 'Type ()', 'new', ...;

sub new { ... }

Get's Type a &new method.

INTERFACE

SET_DESCRIPTION(type, description)

Is called one time on import.

UNIVERSAL OBJECT

If you havn't specified any supertype then the following functions are available.

OVERLOADS

bool => Returns YES.
int  => Same as getId.
<=>  => Compares two object ids.
cmp  => Compares two objects stringwise.
""   => Same as toString.

METHODS

NEW

Returns a new instance. A new type should specify its own 'new' method.

getType

Returns the type of the object as string.

getId

Returns the id of the object as integer.

getHierarchy

Returns an array reference.

toString

Same as overload::StrVal. A new type should specify its own 'toString' method.