view release on metacpan or search on metacpan
i18n/Aion/Meta/Feature.ru-en.po view on Meta::CPAN
"The serial number of the feature in the class."
msgid "## required (;$bool)\n"
"Флаг обÑзаÑелÑноÑÑи ÑиÑи в конÑÑÑÑкÑоÑе (`new`)."
msgstr "## required (;$bool)\n"
"Flag for requiring a feature in the constructor (`new`)."
msgid "## excessive (;$bool)\n"
"Флаг избÑÑоÑноÑÑи ÑиÑи в конÑÑÑÑкÑоÑе (`new`). ÐÑли она Ñам еÑÑÑ Ð´Ð¾Ð»Ð¶Ð½Ð¾ вÑбÑаÑÑваÑÑÑÑ Ð¸ÑклÑÑение."
msgstr "## excessive (;$bool)\n"
"Feature redundancy flag in the constructor (`new`). If it is there, an exception should be thrown."
msgid "## isa (;Object[Aion::Type])\n"
"ÐгÑаниÑение Ñипа Ð´Ð»Ñ Ð·Ð½Ð°ÑÐµÐ½Ð¸Ñ ÑиÑи."
msgstr "## isa (;Object[Aion::Type])\n"
"Type constraint on feature value."
msgid "## lazy (;$bool)\n"
"Флаг ленивой иниÑиализаÑии."
msgstr "## lazy (;$bool)\n"
"Lazy initialization flag."
i18n/Aion/Meta/Feature.ru-en.po view on Meta::CPAN
"ÐозвÑаÑÐ°ÐµÑ ÐºÐ¾Ð´ в виде ÑекÑÑа Ð´Ð»Ñ Ð´Ð¾ÑÑÑпа к меÑаинÑоÑмаÑии ÑиÑи."
msgstr "## meta()\n"
"Returns code as text to access the feature's meta information."
msgid "## stash ($key; $val)\n"
"ÐоÑÑÑп к Ñ
ÑанилиÑÑ ÑвойÑÑв Ð´Ð»Ñ Ð²ÑзÑваÑÑего пакеÑа."
msgstr "## stash ($key; $val)\n"
"Access the property store for the calling package."
msgid "СÑÐ°Ð²Ð½Ð¸Ð²Ð°ÐµÑ ÑÑаÑÑÑ ÑиÑÑ Ñ Ð¿ÐµÑезагÑÑжаемой. ÐÑли ÑвойÑÑво `isa` Ñказано и не ÑовпадÑÑ, Ñо бÑÐ´ÐµÑ Ð²ÑбÑоÑено иÑклÑÑение."
msgstr "Compares the old feature with the rebooted one. If the `isa` property is specified and does not match, an exception will be thrown."
msgid "â **GPLv3**"
msgstr "â **GPLv3**"
msgid "The Aion::Meta::Feature module is copyright © 2025 Yaroslav O. Kosmina. Rusland. All rights reserved."
msgstr "The Aion::Meta::Feature module is copyright © 2025 Yaroslav O. Kosmina. Rusland. All rights reserved."
i18n/Aion/Meta/Subroutine.ru-en.po view on Meta::CPAN
msgid "Ð Ñак же ÑоздаÑÑ ÑÑнкÑиÑ-обÑÑÑÐºÑ Ð¿ÑовеÑÑÑÑÑÑ ÑигнаÑÑÑÑ."
msgstr "It also creates a wrapper function that checks the signature."
msgid "ÐонÑÑÑÑкÑоÑ."
msgstr "Constructor."
msgid "СоздаÑÑ ÑÑнкÑиÑ-обÑÑÑÐºÑ Ð¿ÑовеÑÑÑÑÑÑ ÑигнаÑÑÑÑ."
msgstr "Creates a wrapper function that checks the signature."
msgid "СвеÑÑÐµÑ ÑÐ²Ð¾Ñ (ожидаемÑÑ) ÑигнаÑÑÑÑ Ñ Ð¾Ð±ÑÑвленной Ñ ÑÑнкÑии в модÑле и вÑбÑаÑÑÐ²Ð°ÐµÑ Ð¸ÑклÑÑение, еÑли ÑигнаÑÑÑÑ Ð½Ðµ ÑовпадаÑÑ."
msgstr "Checks its (expected) signature against the one declared by the function in the module and throws an exception if the signatures do not match."
msgid "СÑÑоковое опиÑание ÑÑнкÑии."
msgstr "String description of the function."
msgid "ÐозвÑаÑÐ°ÐµÑ Ð¸Ð¼Ñ Ð¿Ð°ÐºÐµÑа, в коÑоÑом обÑÑвлена ÑÑнкÑиÑ."
msgstr "Returns the name of the package in which the function is declared."
msgid "ÐозвÑаÑÐ°ÐµÑ Ð¸Ð¼Ñ ÑÑнкÑии."
msgstr "Returns the name of the function."
i18n/Aion/Type.ru-en.po view on Meta::CPAN
msgid "ÐÑивеÑÑи `$value` к ÑипÑ, еÑли пÑиведение из Ñипа и ÑÑнкÑии наÑ
одиÑÑÑ Ð² `$self->{coerce}`."
msgstr "Cast `$value` to type if the cast from type and function is in `$self->{coerce}`."
msgid "СооÑвеÑÑÑвÑÐµÑ Ð¾Ð¿ÐµÑаÑоÑÑ `>>`."
msgstr "Corresponds to the `>>` operator."
msgid "ФоÑмиÑÑÐµÑ ÑообÑение оÑибки."
msgstr "Generates an error message."
msgid "ÐÑовеÑÑÐµÑ `$element` и вÑбÑаÑÑÐ²Ð°ÐµÑ ÑообÑение `detail`, еÑли ÑÐ»ÐµÐ¼ÐµÐ½Ñ Ð½Ðµ пÑÐ¸Ð½Ð°Ð´Ð»ÐµÐ¶Ð¸Ñ ÐºÐ»Ð°ÑÑÑ."
msgstr "Checks `$element` and throws a `detail` message if the element does not belong to the class."
msgid "ÐеÑÐµÐ²Ð¾Ð´Ð¸Ñ `$val` в ÑÑÑокÑ."
msgstr "Converts `$val` to a string."
msgid "ÐпÑеделÑеÑ, ÑÑо Ñип ÑвлÑеÑÑÑ Ð¿Ð¾Ð´Ñипом дÑÑгого `$type` по имени Ñипа."
msgstr "Determines that a type is a subtype of another `$type` by type name."
msgid "Ð `|` и `~` не заÑ
одиÑ. ÐÑгÑменÑÑ Ð½Ðµ пÑовеÑÑеÑ."
msgstr "Doesn't work in `|` and `~`. Doesn't check arguments."
i18n/Aion/Type.ru-en.po view on Meta::CPAN
msgid "ÐÑли Ñказан `init` Ñо пÑи каждом иÑполÑзовании подпÑогÑÐ°Ð¼Ð¼Ñ Ð±ÑÐ´ÐµÑ ÑоздаваÑÑÑÑ Ñип и иниÑиализиÑоваÑÑÑÑ."
msgstr "If `init` is specified, then each time the subroutine is used, a type will be created and initialized."
msgid "Ð¡Ð¾Ð·Ð´Ð°ÐµÑ Ð¿Ð¾Ð´Ð¿ÑогÑÐ°Ð¼Ð¼Ñ Ñ Ð°ÑгÑменÑами, коÑоÑÐ°Ñ Ð²Ð¾Ð·Ð²ÑаÑÐ°ÐµÑ Ñип."
msgstr "Creates a subroutine with arguments that returns a type."
msgid "Ð¡Ð¾Ð·Ð´Ð°ÐµÑ Ð¿Ð¾Ð´Ð¿ÑогÑÐ°Ð¼Ð¼Ñ Ñ Ð°ÑгÑменÑами или без."
msgstr "Creates a subroutine with or without arguments."
msgid "ÐÑли подпÑогÑамма не Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ñоздана, Ñо вÑбÑаÑÑваеÑÑÑ Ð¸ÑклÑÑение."
msgstr "If the routine cannot be created, an exception is thrown."
msgid "СпиÑок аÑгÑменÑов."
msgstr "List of arguments."
msgid "ÐÐ¼Ñ Ñипа."
msgstr "Type name."
msgid "РодиÑелÑÑкий Ñип."
msgstr "Parent type."
i18n/Aion/Types.ru-en.po view on Meta::CPAN
msgid "ÐÑполÑзÑеÑÑÑ Ñ `subtype` Ð´Ð»Ñ Ð²Ñвода ÑообÑÐµÐ½Ð¸Ñ Ð¾Ð± оÑибке, еÑли знаÑение иÑклÑÑÐ°ÐµÑ Ñип. Ð `$code` иÑполÑзÑеÑÑÑ: `SELF` - ÑекÑÑий Ñип, `ARGS`, `A`, `B`, `C`, `D...
msgstr "Used with `subtype` to print an error message if the value excludes the type. `$code` uses: `SELF` - the current type, `ARGS`, `A`, `B`, `C`, `D` - type arguments (if any) and a test value in `$_`. It can be converted to a string using `SELF-...
msgid "ÐобавлÑÐµÑ Ð½Ð¾Ð²Ð¾Ðµ пÑиведение (`$via`) к `$type` из `$from` Ñипа."
msgstr "Adds a new cast (`$via`) to `$type` from `$from` type."
msgid "ÐÐ¾Ð¶ÐµÑ Ð¸ÑполÑзоваÑÑ Ð¿Ð°ÑамеÑÑÑ Ñипа:"
msgstr "Can use parameters like:"
msgid "`coerce` вÑбÑаÑÑÐ²Ð°ÐµÑ Ð¸ÑклÑÑениÑ:"
msgstr "`coerce` throws exceptions:"
msgid "СÑандаÑÑнÑе пÑиведениÑ:"
msgstr "Standard casts:"
msgid "СинÑакÑиÑеÑкий ÑаÑ
Ð°Ñ Ð´Ð»Ñ `coerce`."
msgstr "Syntactic sugar for `coerce`."
msgid "ÐÑовеÑÑÐµÑ ÑигнаÑÑÑÑ Ð¿Ð¾Ð´Ð¿ÑогÑаммÑ: аÑгÑменÑÑ Ð¸ ÑезÑлÑÑаÑÑ."
msgstr "Checks the signature of a subroutine: arguments and results."
lib/Aion/Meta/Feature.pm view on Meta::CPAN
=head2 required (;$bool)
Flag for requiring a feature in the constructor (C<new>).
$::feature->required(1);
$::feature->required # -> 1
=head2 excessive (;$bool)
Feature redundancy flag in the constructor (C<new>). If it is there, an exception should be thrown.
$::feature->excessive(1);
$::feature->excessive # -> 1
=head2 isa (;Object[Aion::Type])
Type constraint on feature value.
use Aion::Type;
lib/Aion/Meta/Feature.pm view on Meta::CPAN
=head2 stash ($key; $val)
Access the property store for the calling package.
$::feature->stash('my_key', 'my_value');
$::feature->stash('my_key') # -> 'my_value'
=head2 compare ($other)
Compares the old feature with the rebooted one. If the C<isa> property is specified and does not match, an exception will be thrown.
=head1 AUTHOR
Yaroslav O. Kosmina L<mailto:dart@cpan.org>
=head1 LICENSE
â B<GPLv3>
=head1 COPYRIGHT
lib/Aion/Meta/Subroutine.pm view on Meta::CPAN
=head2 new (%args)
Constructor.
=head2 wrap_sub ()
Creates a wrapper function that checks the signature.
=head2 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.
=head2 stringify ()
String description of the function.
=head2 pkg ()
Returns the name of the package in which the function is declared.
=head2 subname ()
lib/Aion/Type.pm view on Meta::CPAN
$Int->detail(-5, "Feature car") # => Feature car must have the type Int. The it is -5!
my $Num = Aion::Type->new(name => "Num", message => sub {
"Error: $_ is'nt $Aion::Type::SELF->{property}!"
});
$Num->detail("x", "car") # => Error: x is'nt car!
=head2 validate ($element, $feature)
Checks C<$element> and throws a C<detail> message if the element does not belong to the class.
my $PositiveInt = Aion::Type->new(
name => "PositiveInt",
test => sub { /^\d+$/ },
);
eval {
$PositiveInt->validate(-1, "Neg")
};
$@ # ~> Neg must have the type PositiveInt. The it is -1
lib/Aion/Type.pm view on Meta::CPAN
BEGIN {
Aion::Type->new(name=>"Rim", test => sub { /^[IVXLCDM]+$/i })->make(__PACKAGE__);
}
"IX" ~~ Rim # => 1
If C<init> is specified, then each time the subroutine is used, a type will be created and initialized.
eval { Aion::Type->new(name=>"Rim", init => sub {...})->make(__PACKAGE__) }; $@ # ~> init_where won't work in Rim
If the routine cannot be created, an exception is thrown.
eval { Aion::Type->new(name=>"Rim")->make }; $@ # ~> syntax error
=head2 make_arg ($pkg)
Creates a subroutine with arguments that returns a type.
BEGIN {
Aion::Type->new(name=>"Len", test => sub {
$Aion::Type::SELF->{args}[0] <= length($_) && length($_) <= $Aion::Type::SELF->{args}[1]
})->make_arg(__PACKAGE__, 1);
}
"IX" ~~ Len[2,2] # => 1
If the routine cannot be created, an exception is thrown.
eval { Aion::Type->new(name=>"Rim")->make_arg }; $@ # ~> syntax error
=head2 make_maybe_arg ($pkg)
Creates a subroutine with or without arguments.
BEGIN {
Aion::Type->new(
name => "Enum123",
test => sub { $_ ~~ [1,2,3] },
a_test => sub { $_ ~~ $Aion::Type::SELF->{args} },
)->make_maybe_arg(__PACKAGE__);
}
3 ~~ Enum123 # -> 1
3 ~~ Enum123[4,5,6] # -> ""
5 ~~ Enum123[4,5,6] # -> 1
If the routine cannot be created, an exception is thrown.
eval { Aion::Type->new(name=>"Rim")->make_maybe_arg }; $@ # ~> syntax error
=head2 args ()
List of arguments.
=head2 name ()
Type name.
lib/Aion/Types.pm view on Meta::CPAN
BEGIN {
subtype 'Plus[acc]', as Num;
}
coerce &Plus, from Num, via { $_ + A };
Plus([5])->coerce(4) # -> 9
Plus([5]) >> 5 # -> 10
1 >> Plus[5] # -> 6
C<coerce> throws exceptions:
eval {coerce Int, via1 => 1}; $@ # ~> coerce Int unused keys left: via1
eval {coerce "x"}; $@ # ~> coerce x not Aion::Type!
eval {coerce Int}; $@ # ~> coerce Int: from is'nt Aion::Type!
eval {coerce Int, from "x"}; $@ # ~> coerce Int: from is'nt Aion::Type!
eval {coerce Int, from Num}; $@ # ~> coerce Int: via is not subroutine!
eval {coerce Int, (from=>Num, via=>"x")}; $@ # ~> coerce Int: via is not subroutine!
Standard casts: