Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

perl5 int, double, string type implementations without checks

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 t
Octocat-spinner-32 Makefile.PL
Octocat-spinner-32 README
Octocat-spinner-32 coretypes.pm
Octocat-spinner-32 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

Something went wrong with that request. Please try again.