This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html
Set by lizmat on 8 June 2022.
guifa m: sub report(\var) { say "The variable {with var.VAR.^find_method('name') { var.VAR.name } else { '⟨anon⟩' } } has the value of {var}" }; my $a = 2; report $a; report 2 00:07
camelia The variable $a has the value of 2
The variable ⟨anon⟩ has the value of 2
Nemokosch consider bindings which can trick it 00:25
guifa Well yeah, but at that point there's nothing you can do 00:35
If you do my $a = 2; my $b := $a; report $b, there's going to be no way to access $b AFAIK 00:36
m: my $a = 2; my $b := $a; say $b.VAR.name
camelia $a
gfldex m:``` 18:36
use experimental :macros;
macro symbol-name($symbol) {
quasi { $symbol.Str }
}
my $foo;
my $bar := $foo;
say symbol-name($foo);
say symbol-name($bar);
```
<@297037173541175296> your bindings can't scare me as I got a macro! 18:37
gfldex deoac: ^^^