Aion

 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:



( run in 1.169 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )