auto-dynamic

NAME

auto-dynamic - automatically vivify dynamic variables

SYNOPSIS

use auto-dynamic;

$*foo = 42;
say $*foo;  # 42

%*hash<a> = 666;
dd %*hash;  # {:a(666)}

@*array[2] = "ok";
say @*array;  # [Any, Any, "ok"]

&*handler = { say "duh" }
&*handler();  # duh

DESCRIPTION

Unknown dynamic variables return a Failure in standard Raku. That may be undesired in some situations.

The auto-dynamic distribution enables the automatic vivification of dynamic variables in the scope in which the use statement is executed. It is the no strict equivalent for dynamic variables.

CAUTION

The functionality of this distribution relies on the current way that accesses to dynamic variables are being turned into bytecode. Which may change at any point in the future. As such, this distribution is more intended as a proof of concept.

AUTHOR

Elizabeth Mattijsen <[email protected]>

Source can be located at: https://codeberg.org/lizmat/auto-dynamic . Comments and Pull Requests are welcome.

If you like this module, or what I'm doing more generally, committing to a small sponsorship would mean a great deal to me!

COPYRIGHT AND LICENSE

Copyright 2024, 2026 Elizabeth Mattijsen

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

auto-dynamic v0.0.2

automatically vivify dynamic variables

Authors

  • Elizabeth Mattijsen

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • auto-dynamic

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.