|
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. |
|||
|
01:44
razetime joined
02:27
archenoth joined
02:28
archenoth left,
archenoth joined
02:30
Oshawott left
03:48
guifa_ left,
MasterDuke left
03:49
guifa joined
03:55
razetime left
03:58
Heptite left
04:37
razetime joined
|
|||
| zacque | Rant: Didn't expect the flattening effect of zip! | 06:21 | |
| How can I prevent flattening such that some `((1,2)) Z ((3,4))` produces `(((1,2), (3,4)))`? | 06:24 | ||
| Nemokosch | That's not flattening - ((1, 2)) is not a nested list. | 06:42 | |
| It's the very same thing as (1, 2) | |||
| If you want the nested list, write ((1, 2),) | 06:44 | ||
| (The comma operator constructs the list, not the parens) | |||
| zacque | Ah, you're right! Didn't notice that | 07:01 | |
| That solves my problem, haha! Tq very much 😄 | 07:02 | ||
| Nemokosch | That one was an easy win, at least | 07:03 | |
|
08:09
dakkar joined
|
|||
| CIAvash | or maybe `$(1,2) Z $(3,4)` | 08:15 | |
| Nemokosch | that generates weird output, by the way | 08:28 | |
| oops nevermind, I was just stupid | |||
| Still, I don't get why $(1, 2) Z $(3, 4) is double-nested | 08:29 | ||
| Zephyr | comma operator creates a list by itself, I think explicitly creating a list that wraps it makes it double nested? | 08:31 | |
| Nemokosch | I suppose $(1, 2) is like an item | 08:32 | |
| m: dd 1 Z 2 | |||
| do items turn into one-element lists implicitly, again? 😆 | 08:33 | ||
| Zephyr | wait nvm, $(1, 2) isn't a nested list | ||
| I guess yes then it's transforming an item into an one-element list... didn't expect that | 08:34 | ||
| CIAvash | `$(1,2)` is the same as `(1,2).item` | 08:45 | |
|
09:48
razetime left
10:20
frost16 joined
|
|||
| zacque | ClAvash: `$(1,2)` works too, thanks! | 11:19 | |
| I'm confused, should I implement `cmp` inside my custom class, or a `multi sub` outside it? | 11:21 | ||
| But if I implement it as a `multi sub`, it will need to have access to some internal details 😦 | 11:22 | ||
|
11:36
Kaiepi joined
|
|||
| Nemokosch | I wonder docs.raku.org/routine/trusts | 11:42 | |
| zacque | I don't think it helps, since I'm comparing two objects of the same class | 11:58 | |
|
12:02
razetime joined
|
|||
| Nemokosch | yeah I mean maybe there is something like "friend" in C++? | 12:11 | |
| zacque | Ya, but how does it help? | 12:13 | |
| Nemokosch | well, do you know what a friend function is? 🤔 | 12:19 | |
| zacque | Yup, a friend class has access to all private and public attributes and functions | 12:57 | |
| A friend function, not sure.. | 12:58 | ||
| Nemokosch | same but as a function 😛 | ||
| zacque | With public attributes, I can do something like this: paste.debian.net/1257585/ | ||
| Huh? Is there such a thing as friend function in Raku? 😮 | 12:59 | ||
| Nemokosch | I don't know | ||
| that's the thing... | |||
| zacque | Lol hahaha | ||
|
13:03
jgaz joined
|
|||
| Nemokosch | it exists in C++ at least | 13:04 | |
| zacque | Ok... | 13:29 | |
| Is there a way to compare two objects of the same class without exposing internal details? I'd like to keep everything private though | 13:31 | ||
| Nemokosch | method infix:<cmp> seems to work | 13:36 | |
| lizmat | zacque: if these objects are value types, then maybe docs.raku.org/type/ValueObjAt is interesting | 13:56 | |
|
14:13
frost16 left
14:18
habere-et-disper joined
|
|||
| habere-et-disper | Hi all o/ | 14:18 | |
| :-) | |||
| Hoes does the control flow keyword `lift` work? | |||
| I can't find any documentation. | |||
| Thanks! | |||
| zacque | lizmat: That helps! How do I compare two objects then? Do I have to invoke `WHICH` on both objects? | 14:25 | |
|
14:43
deoac joined
|
|||
| deoac | what is the meaning of ` FATAL: Empty input word set `  ? | 14:46 | |
|
14:48
Heptite joined
16:42
dakkar left
16:46
deoac left,
razetime left
|
|||
| lizmat | zacque using the identity operator docs.raku.org/routine/===,%20infix%20â©¶ | 17:03 | |
| Nemokosch | lizmat: what does =:= use? | 17:25 | |
| lizmat | the actual memory address: aka, whether they are referring to actually the same object | ||
|
17:30
m_athias left
17:31
m_athias joined
18:14
habere-et-disper left
|
|||
| Nemokosch | thankies | 19:19 | |
|
19:59
Kaiepi left,
Kaiepi joined
20:04
Kaiepi left
20:05
Kaiepi joined
20:08
Kaiepi left,
Kaiepi joined
21:11
jgaz left
|
|||
| zacque | lizmat: Ah, I see. Thx! | 22:33 | |
| lizmat | habere-et-disper: where did you read about "lift" ? it was never implemented | 22:49 | |
| Mofu | This seems like a harmless place to fawn over Raku, so I'm here to say I appreciate how life-changing Raku can be for quick and dirty scripting. For example just using `sub MAIN($somearg = "blah")` for passing cmdline args to the script be magic, instead of having to do the usual ARGV array/length parsing boilerplate. | 23:23 | |
| guifa | Mofu: glad to have you enjoying it! | 23:43 | |
| Mofu | I haven't felt this lazy since I first learned Ruby lol. | 23:48 | |