We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b50321 commit 5b0448dCopy full SHA for 5b0448d
doc/Type/Variable.pod6
@@ -68,6 +68,22 @@ introspect; # OUTPUT: «23»
68
}
69
=end code
70
71
+The C<is dynamic> trait is a rather cumbersome way of creating and accessing
72
+dynamic variables. A much easier way is to use the C<* twigil>:
73
+
74
+=begin code :allow<B L>
75
+sub introspect() {
76
+ say B<$*x>;
77
+}
78
+my $*x = 23;
79
+introspect; # OUTPUT: «23»
80
+{
81
+ # not dynamic
82
+ my $x;
83
+ introspect() # dies with an exception of L<type X::Dynamic::NotFound.new|/type/X::Dynamic::NotFound.new>
84
85
+=end code
86
87
=head2 trait of
88
89
multi sub trait_mod:<of>(Mu:U $target, Mu:U $type)
0 commit comments