03:00
razetime joined
03:24
razetime left,
razetime joined
04:43
razetime left
07:13
razetime joined
07:14
razetime left,
razetime joined
08:55
razetime left
11:39
razetime joined
|
|||
lizmat | and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2022/02/07/2022-06-basicly/ | 13:55 | |
13:59
discord-raku-bot left,
discord-raku-bot joined
|
|||
Nemokosch | I have a two-element array. How do I pass it to `cmp`? | 15:57 | |
15:59
discord-raku-bot left
16:00
discord-raku-bot joined
|
|||
lizmat | m: my @a = 1,2; say infix:<cmp>(|@a) | 16:08 | |
camelia | Less | ||
Nemokosch | yes, a bit later I realized this way is on | 16:24 | |
I wonder if it's possible in a postfix way, though | |||
lizmat | if you find a way, let me know :-) | 16:26 | |
Nemokosch | I tend to prefer the postfix, method-looking chaining, I find it more readable | 16:28 | |
but it seems to me that comes with serious limitations regarding the signatures the runtime can infer | |||
thowe | The duplicates I find on raku.land confuse me... When I search for DNS and fine 2 Net::DNS modules, what am I looking at? Are they the same? If not, which one gets installed when I install with zef? | 17:21 | |
one says zef:RBT the other cpan:RBT so, what's the distinction? I'm assuming same code as they point to same github repo | 17:24 | ||
17:37
razetime left
|
|||
lizmat | thowe: that indicates a module that has been migrated off CPAN to the zef ecosystem | 17:41 | |
The CPAN versions are older versions (generally) | 17:42 | ||
thowe | Ah, OK. Thank you. | ||
lizmat | that's also the reason why I'm listed twice in Prolific Authors | 17:43 | |
but soon no more, since zef now also supports the REA as a backpan, so I can remove my modules from CPAN safely now | 17:44 | ||
m_athias | good evening everyone! is there some syntactic sugar to look 'one ahead' in a for loop? | 17:54 | |
thowe | I don't know what sugar would be, but obviously if you have an iterator you can point one ahead. I'm guessing you know that and it isn't what you want. But it not using the list or array with an iterator, I'm not sure the loop is aware of the entire list in order to look ahead on it, no? | 18:05 | |
m_athias | thats what I'll probably end up using. I was just wondering if there is something 'nicer' around. | 18:25 | |
Nemokosch | I'm not sure how much performance matters to you but there is the "ziptail" functionality | 18:27 | |
m: (0..*) Z (1..*) andthen .head(10).say | 18:28 | ||
m: (0..\*) Z (1..\*) andthen .head(10).say | |||
nevermind the error, I edited the message to make it readable | |||
so yeah, if you have some iterable $x, you can do | 18:30 | ||
$x Z $x.skip | |||
and get a new iterable that contains neighborous values as elements | 18:31 | ||
18:41
ajr joined
|
|||
thowe | how do I turn this into a one liner without it being choked on? "[10, 25, 50, 75, 100, 150, 200, 300, 400, 500].map: { put $_ ~ ' is ' ~ ($_ * 1024 * 1.05) };" | 18:52 | |
19:46
CIAvash left
19:47
anight[m] left
20:23
anight[m] joined
20:29
CIAvash joined
|
|||
gfldex | m: .say for (^10).rotor(2=>-1).flat.map: -> $c, $n { „current: $c, next: $n“ }; | 20:56 | |
camelia | current: 0, next: 1 current: 1, next: 2 current: 2, next: 3 current: 3, next: 4 current: 4, next: 5 current: 5, next: 6 current: 6, next: 7 current: 7, next: 8 current: 8, next: 9 |
||
gfldex | m_athias: ^^^ | ||
Nemokosch | that's the same as $z Z $z.skip for the most part | 21:05 | |
there was a very good presentation on the raku conference last year | |||
gfldex | Does that work with `Seq` and `HyperSeq`? | 21:07 | |
Nemokosch | It definitely works with Seq and I'm not sure if I know what HyperSeq even is | 21:13 | |
gfldex | The things that drops out of `.hyper`. | ||
m:``` | 21:16 | ||
my \a = (^∞).hyper.grep(*.is-prime); | |||
.say for a Z a.skip; | |||
``` | |||
m:``` | 21:17 | ||
my @a = lazy (^∞).hyper.grep(*.is-prime); | |||
.say for @a Z @a.skip; | |||
``` | |||
That works but there is some reification going on, what might be undesirable. | 21:18 | ||
Nemokosch | what is reification? | 21:22 | |
MasterDuke | in this case, not skipping the potentially skippable parts of a lazy sequence | 21:25 | |
gfldex | `@a` will retain values that are already computed. Those values may fill up all your RAMs, what can cause problems down the road. If you use a subscript of `[1_000_000]` you will get the one millionth prime and all primes before that until `@a` goes out of scope. | 21:32 | |
Nemokosch | tbh I don't really get the meaning of hypering | 21:34 | |
is this about the auto-threading? | |||
gfldex | yes | ||
21:35
CIAvash left,
anight[m] left
21:38
CIAvash joined
|
|||
Nemokosch | okay, nice | 21:39 | |
21:39
anight[m] joined
22:09
ajr left
22:51
ajr joined
22:57
ajr left
23:23
ajr joined
23:28
ajr left
23:50
ajr joined
|