00:29 RakuIRCLogger left 07:59 dakkar joined 11:20 apogee_ntv joined 11:50 dakkar left 11:51 dakkar joined 12:40 dakkar left 12:41 dakkar joined
disbot4 <comborico> Is there any difference between %foo and %foo{} ? 16:07
<comborico> %foo{} is needed with 'say'. say "%foo" will not work. 16:20
16:29 dakkar left
disbot4 <comborico> What is .tc method? 16:47
<comborico> Now I mean, what does it stand for. It capitalizes. But what is the 't' for? 16:49
lizmat tc == titlecase 17:19
%foo is the hash itself, %hash{} (or %hash<>) is the zen-slice 17:20
it's basically the same as the hash itself, but that way you can use it in a double quoted string
m: my %hash = :42a, :666b; dd %hash; say "hash = %hash"; say "hash = %hash<>" 17:22
camelia {:a(42), :b(666)}
hash = %hash
hash = a 42
b 666
lizmat although the zen-slice is not so useful on hashes
m: my @a = 1..10; say "a = @a"; say "a = @a[]" 17:23
camelia a = @a
a = 1 2 3 4 5 6 7 8 9 10
lizmat makes more sense with arrays
PSA: if you're here because you're interested in the Raku Programming Language and its community, please register yourself: raku.foundation 17:34
it will help us reach you!
disbot4 <comborico> Thanks! 18:42
<comborico> Why does 'a' not get iterated over twice, and the total be 34? pastebin.com/Gj9w8CJj 20:16
lizmat that's an interesting mix of code concepts you got there 20:20
disbot4 <comborico> It comes from uzluisf 20:21
lizmat if you look at the dd of the for loop, you get: 20:24
(:b(34), :z(3), :a(17), :a(17))
so you're basically assigning the %letter-freq<a> twice 20:25
disbot4 <comborico> I read about dd. I need to see it more in code/tutorials. This is an excellent example for it's purpose. I'll note it down. 20:27
20:48 RakuIRCLogger joined