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. |
|||
00:00
Kaipei is now known as Kaiepi
|
|||
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 | ||
00:39
deoac left
07:25
frost joined
07:46
RakuIRCLogger left
08:07
dakkar joined
08:32
Oshawott left
08:33
Oshawott joined
09:32
lizmat_ joined
09:34
lizmat__ joined
09:35
lizmat___ joined
09:36
lizmat left
09:37
lizmat_ left
09:39
lizmat__ left
09:40
lizmat___ is now known as lizmat
14:28
frost left
15:22
guifa_ joined
15:25
guifa left
16:36
dakkar left
17:47
deoac joined
18:17
human-blip left
18:18
human-blip joined
|
|||
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: ^^^ | ||
18:51
deoac left
|