perl5 int, double, string type implementations without checks
Perl
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
t
Makefile.PL
README
coretypes.pm
coretypes.xs

README

NAME
    coretypes - my [const] int, double, string $@%variables

DESCRIPTION
    Parse int, double and string as type, provide packages and implement the
    changed datastructures.

    We have to support two different implementations:

    As backwards compatible CPAN extension implemented only as slow tie
    methods, and 2nd in core with patched parser hooks targetting 5.18 and
    faster and smaller structures.

    Use those 3 new native types in declarations of lexical scalars, arrays
    and hashes, but not in globals. Add a new lexical type qualifier
    "const", see <https://github.com/rurban/perl/commits/typed/ro>

        my int $i;         # no magic allowed, with type-optim and type checks.
        my double $d;      #               -"-
        our string $s;     #               -"-

        my int @array;     # typed IV array, with type-optim. and type checks.
        my int @array[20]; # typed and fixed-sized, with type and size checks.
        my const int @array; # typed IV array, with better type-optim. and type checks.

        my string %hash;   # typed PV hash, with type-optim. and type checks

        our const string %hash = {'foo' => 'bar'};
                           # perfect hash with type-optim. and type checks

    This package does NOT handle attributes, as there is no compile-time
    attribute hook for my lexicals yet, and attribute parsing and handling
    is unstable and even considered dangerous (Attribute::Handler evals
    them). Type qualifiers, such as "const" or "unsigned" can be parsed
    upfront as in C, or rely on an additional "CHECK_*_ATTRIBUTES" hook.

SEE ALSO
    types for the PP ("pure-perl") old implementation of type checks.

    typesafety for a PP implementation of type inference and type-checks.

    Devel::TypeCheck for the best PP implementation of general type
    inference.

    <https://github.com/rurban/perl/commits/typed/ro> for the const type
    qualifier.

    <https://github.com/rurban/perl/commits/typed/av> for typed arrays.

    <https://github.com/rurban/perl/commits/typed/hv> for typed hashes.

    <https://github.com/rurban/perl/commits/typed/ph> for perfect hashes.

    <https://github.com/rurban/perl/commits/typed/ck> for fast internal type
    checks and optimizations.

    <https://github.com/rurban/perl/commits/typed/sv> for typed scalars.

AUTHOR
    Reini Urban

COPYRIGHT AND LICENSE
    This library is free software under the same terms as perl itself.

    Copyright (c) 2012 Reini Urban