NAME

Aion::Meta::Subroutine - describes a function with a signature

SYNOPSIS

use Aion::Types qw(Int);
use Aion::Meta::Subroutine;

my $subroutine = Aion::Meta::Subroutine->new(
	pkg => 'My::Package',
	subname => 'my_subroutine',
	signature => [Int, Int],
	referent => undef,
);

$subroutine->stringify  # => my_subroutine(Int => Int) of My::Package

DESCRIPTION

Used to declare the required function in interfaces and abstract classes. In this case, referent ~~ Undef.

It also creates a wrapper function that checks the signature.

SUBROUTINES

new (%args)

Constructor.

wrap_sub ()

Creates a wrapper function that checks the signature.

compare ($subroutine)

Checks its (expected) signature against the one declared by the function in the module and throws an exception if the signatures do not match.

stringify ()

String description of the function.

pkg ()

Returns the name of the package in which the function is declared.

subname ()

Returns the name of the function.

signature ()

Returns the function signature.

referent ()

Returns a reference to the original function.

wrapsub ()

Returns a wrapper function that checks the signature.

AUTHOR

Yaroslav O. Kosmina mailto:dart@cpan.org

LICENSE

GPLv3

COPYRIGHT

The Aion::Meta::Subroutine module is copyright © 2025 Yaroslav O. Kosmina. Rusland. All rights reserved.