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.
Todd270 How do I do a binary write to the STDOUT? 13:21
yabobay Todd270: $*OUT.write(blob8.new(65)) 13:30
write accepts a Blob which contains binary data 13:31
anyone know how to set a Hash as a key in a Hash or Pair? it always seems to stringify whenever i try to do it 13:41
oh i see in the docs you literally can't. something else i could do instead? 13:43
lizmat m: my %h{Hash} = { a => 42, b => 666 } => "foobar"; dd %h 13:50
camelia Any = (my Any %{Hash} = {:a(42), :b(666)} => "foobar")
lizmat docs.raku.org/language/hashmap#Non...ject_hash) 13:51
yabobay ^^
yabobay thank you! 13:52
.ohnowendigo Something fun I discovered yesterday: you can use := to give multiple hash keys the same value, which will be useful for giving a value multiple ids 16:46
m: my %h = :5a; %h<b> := %h<a>; %h<b>++; say %h 16:47
Raku eval {a => 6, b => 6}
lizmat ohnowendigo that has nothing to do with hashes, but everything about containers 16:48
m: my $a = 42; my $b := $a; $b = 666; say $a 16:49
camelia 666
.ohnowendigo Use case I'm thinking of: have an internal id for something, but get a temporary autogenerated id when I call an API. So now I can do %h{apicall($id)} := %h{$id} and refer to it either by the internal id or the generated id
lizmat yes, that is a use case! 16:50