Skip to content
This repository


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…


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.xs
    coretypes - my [const] int, double, string $@%variables

    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 <>

        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.

    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

    <> for the const type

    <> for typed arrays.

    <> for typed hashes.

    <> for perfect hashes.

    <> for fast internal type
    checks and optimizations.

    <> for typed scalars.

    Reini Urban

    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.