00:03
riffraff joined
00:08
riffraff left
|
|||
Nemokosch | btw | 00:20 | |
Bag.new and .Bag also don't behave the same way | |||
((1,2), (2,3)).Bag flattens | |||
so it will have elements like 1 2 3 | |||
While Bag.new would keep the lists as the elements | |||
moreover Bag.new doesn't count the duplicates | 00:46 | ||
this is a bit cruel. It compares with === and (1,2) fails on that, no matter that it's immutable | 00:48 | ||
(1,2) !=== (1,2) | |||
I can get by by converting the lists into pairs that do match by === but frankly, one would expect identity to work on plain immutable data | 00:53 | ||
hm, it works with the data sigil! | 00:55 | ||
\\(1,2) === \\(1,2) | |||
gfldex | I would be really careful to use `===`. You are in C-land if you do. | 00:56 | |
Nemokosch | I don't use it - Bag does... | 00:57 | |
this leads to another question - what is (1,2) actually? | |||
if it's apparently not the same as \\(1,2) | |||
is it the same as @(1,2)? | |||
gfldex | Those are instances of `Capture`. Raku-Objects are just C-pointers under the hood. Since value objects are cached, they can return `True` on `===`. | 00:59 | |
Nemokosch | they can whenever they feel like or are they guaranteed to? | ||
gfldex | if you do `1 === 1` you rely on the fact that the compiler reuses the object that is `1`. | ||
The spec demands as such. | |||
If you ask me to list all types that are considered values, I would be at a loss. | |||
Nemokosch | so I can call .Capture on a list to get this \\ version? | 01:01 | |
gfldex | m: put (1,2,3,4).&{ say $_, $_}.Capture.raku; | 01:02 | |
m:``` | 01:03 | ||
put (1,2,3,4).&{ say $_, $_}.Capture.raku; | |||
``` | |||
m: (1,2,3,4).Capture.raku.put; | |||
Nemokosch | okay, this worked, thank you 🙂 | 01:07 | |
Can I get a downwards range? | 01:28 | ||
in fact, the sequence operator will do just fine but I'm still curious | 01:30 | ||
01:34
parv joined
|
|||
I wonder what happens when writing Z... | 01:34 | ||
m: dd (8, 10) Z... (16, 2) | |||
it seems to me that basically a plain zip call happens | |||
Z.. produces ranges tho | |||
m: dd (8, 10) Z.. (16, 2) | |||
I'm pretty sure the former is related to list associativity again because I got an error for an $a ... $b Z $c ... $d kind of call | 01:38 | ||
gfldex | m: dd &infix:<..>; | 01:59 | |
I would have guessed that to be some grammar magic. It's operators all the way down. :) | 02:01 | ||
02:04
riffraff joined
02:09
riffraff left
04:05
riffraff joined
04:10
riffraff left
04:54
riffraff joined
05:09
Kaiepi left,
Kaiepi joined
09:10
dakkar joined
10:00
parv left
|
|||
Nemokosch | How does ... work though? | 10:09 | |
13:25
Kaipi joined
13:27
Kaiepi left
|
|||
gfldex | m: &infix:<...>; | 13:59 | |
m: dd &infix:<...>; | 14:00 | ||
Nemokosch | hmmm | 14:34 | |
`(|)` | |||
How can I unite lists? | 14:50 | ||
lakmatiol | `[|@a,|@b]` I have seen in the docs quite a bit | 14:56 | |
Nemokosch | it works I guess... I kinda miss an operator for this | 15:05 | |
gfldex | m:``` | 15:55 | |
multi sub infix:«|,»(\left, \right) is equiv(&infix:<Z>) { |left, |right } | |||
``` | |||
16:59
TempIRCLogger left
17:00
TempIRCLogger joined
17:11
riffraff left,
riffraff joined,
TempIRCLogger left,
TempIRCLogger joined
17:19
riffraff left
17:20
riffraff joined
17:25
riffraff left
|
|||
SmokeMachine | m: my @a = 1,2,3; my @b = <a b c>; @a.push: |@b; say @a # if you want to mutate it... | 17:28 | |
camelia | [1 2 3 a b c] | ||
SmokeMachine | m: my @a = 1,2,3; my @b = <a b c>; @a.append: @b; say @a | ||
camelia | [1 2 3 a b c] | ||
17:37
dakkar left
17:42
TempIRCLogger left,
TempIRCLogger joined
17:48
riffraff joined
|
|||
Nemokosch | yes, I know that part | 17:52 | |
is there a placeholder argument in signatures, indicating that I don't care about a certain argument for the return value? | |||
gfldex | m: say sub subby($a, $, $b){}; subby(1,2,3); | 17:56 | |
Nemokosch | oh fine | ||
17:57
TempIRCLogger left,
TempIRCLogger joined
18:06
TempIRCLogger left,
TempIRCLogger joined
18:25
riffraff left,
riffraff joined
18:29
riffraff left
18:30
TempIRCLogger left,
TempIRCLogger joined
18:45
TempIRCLogger left,
TempIRCLogger joined
19:23
riffraff joined
19:58
riffraff left,
riffraff joined
20:02
parv joined
20:03
riffraff left
20:48
colemanx left,
colemanx joined
21:05
riffraff joined
22:02
riffraff45 joined
22:05
riffraff45 left,
riffraff45 joined
22:06
riffraff left
22:47
riffraff45 left,
riffraff45 joined
22:52
riffraff45 left
22:56
riffraff45 joined
23:04
riffraff45 left
23:05
riffraff45 joined,
riffraff45 left,
riffraff45 joined
23:10
riffraff45 left
23:25
jgaz joined
23:35
riffraff45 joined
23:45
riffraff45 left
|