🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel! Set by lizmat on 6 September 2022. |
|||
00:00
reportable6 left
00:02
reportable6 joined
00:23
silug left
00:36
jgaz left
01:03
xinming left
01:05
xinming joined
01:30
nine left,
m_athias left,
nine joined,
m_athias joined
01:53
frost joined
01:54
frost left
01:57
frost joined
02:12
tea3po joined
02:13
tea3po left,
tea3po joined
02:16
teatwo left
02:17
frost left
02:50
rf left
02:57
Scotteh left
02:58
Scotteh joined
03:48
deoac left
03:52
cm left
04:02
cm joined
04:23
Sauvin left
04:26
cm left,
cm joined,
Sauvin joined
04:40
cm left
04:46
cm joined
04:55
cm left
05:06
xinming left
05:08
xinming joined
05:22
cm joined
05:34
PipStuart left
05:48
PipStuart joined
05:54
kybr left
05:55
kybr joined
06:00
reportable6 left
06:01
reportable6 joined
06:29
human-blip left
06:31
human-blip joined
07:00
samcv left
07:07
euandreh left
07:22
tejr left
07:29
gabiruh left,
tejr joined,
gabiruh joined
07:35
RakuIRCLogger joined
|
|||
lizmat | . | 07:42 | |
tellable6 | 2023-04-18T21:54:59Z #raku <Xliff> lizmat A simple and obvious soluition. Thanks! | ||
p6steve | ^^ sure - Allomorphs are cool ... but raku (and perl5 IIRC) are both tuned to dwim that numbers are numbers and strings are strings depending on the context. So, in raku, the cmp operator as the smart comparison operator will apply <=> for numeric items and leg for string items and (my understanding from playing around) is that cmp will 'prefer' numbers to strings. So none of this mechanism needs to be surfaced if all | 07:44 | |
you want is to sort some numerics ;-) | |||
08:04
Bocaneri joined
08:05
Bocaneri is now known as Guest2454
08:07
dakkar joined,
Sauvin left
08:09
Guest2454 is now known as Sauvin
08:12
Sgeo left
08:18
jpn joined
|
|||
Voldenet | javascript behaviour is so much more sane: `[5, 1, 2, 25].sort()` gets turned into `[1, 2, 25, 5]` :) | 08:29 | |
m: <1 2 25 5>.map(*.Str).sort.say | |||
camelia | (1 2 25 5) | ||
Voldenet | I'm glad this expected behaviour can be emulated easily ;> | 08:30 | |
08:31
cm left
08:32
cm joined
|
|||
lizmat | m: <1 2 25 5>.sort(~*).say # no need for map | 08:33 | |
camelia | (1 2 25 5) | ||
lizmat | m: dd <1 2 25 5>.sort(~*) | ||
camelia | (IntStr.new(1, "1"), IntStr.new(2, "2"), IntStr.new(25, "25"), IntStr.new(5, "5")).Seq | ||
lizmat | note that this also keeps the allomorphiness | ||
Voldenet | m: <1 2 25 5>.sort(*.elems).say | 08:45 | |
camelia | (1 2 25 5) | ||
Voldenet | …it produces expected result ;) | ||
lizmat | yeah, the sort is stable | ||
Nemokosch | lol | 08:49 | |
m: <1 2 25 5>.sort(*.chars).say | |||
Raku eval | (1 2 5 25) | ||
Nemokosch | ez win | ||
09:01
euandreh joined
10:01
evalable6 left
10:04
evalable6 joined
10:16
frost joined
10:32
frost left
11:32
statisfiable6 left,
sourceable6 left,
greppable6 left,
bisectable6 left,
releasable6 left,
nativecallable6 left,
bloatable6 left,
unicodable6 left,
benchable6 left,
committable6 left,
shareable6 left,
quotable6 left,
coverable6 left,
reportable6 left,
notable6 left,
tellable6 left,
evalable6 left,
squashable6 left,
linkable6 left
11:33
tellable6 joined,
nativecallable6 joined,
nine left,
m_athias left,
nine joined,
unicodable6 joined,
m_athias joined,
greppable6 joined,
committable6 joined
11:34
linkable6 joined,
quotable6 joined,
benchable6 joined,
notable6 joined,
squashable6 joined,
statisfiable6 joined
11:35
sourceable6 joined,
coverable6 joined,
shareable6 joined,
bloatable6 joined,
releasable6 joined,
bisectable6 joined,
reportable6 joined,
evalable6 joined
12:00
reportable6 left
12:01
reportable6 joined
12:23
nebuchadnezzar joined
12:39
jpn left
13:00
jpn joined
13:05
jpn left
13:12
perlbot left,
simcop2387 left
13:29
jgaz joined
13:31
jpn joined
|
|||
uzl[m] | I'd appreciate a look at this PR: github.com/Raku/doc/pull/4284/files | 13:32 | |
I've received some great feedback from 2colours and coke but I figured a few more eyes on it wouldn't hurt :-) | |||
What's the Raku equivalent for this NodeJS code?... (full message at <libera.ems.host/_matrix/media/v3/d...3d5c1>) | 13:39 | ||
It's probably worth asking in SO to add to the raku questions count :) | |||
lizmat | indeed :-) | 13:40 | |
only 39 to go to 2000 :-) | |||
uzl[m] | I'm a novice when it comes to asynchronous (and event-driven) programming so I'm sort of like trying to map concepts between languages even though I know they don't map 1-to-1 but it does help regardless | 13:42 | |
Wow that's awesome. Only a few years ago, it was in the hundreds | |||
Btw does JJ still hang out in the chat? | 13:43 | ||
lizmat | no... he's easier to reach on the birdsite | 13:49 | |
ugexe | i dont think there is something exactly equivalent | 13:52 | |
specifically the sending a message when it "starts" and sending a value to the "end" handler | 13:53 | ||
m: my $eventEmitter = Supplier.new; my $eventConsumer = $eventEmitter.Supply; $eventConsumer.tap({ once say "started" }); $eventConsumer.tap(-> $_ { say $_ }, done => { say "ended" }); $eventEmitter.emit("start"); $eventEmitter.done() | |||
camelia | started start ended |
||
ugexe | thats close, but not exactly what you asked for | ||
notable that the last bit, $eventEmitter.done() can't be $eventEmitter.done(23) | 13:56 | ||
14:09
japhb left
14:11
japhb joined,
tea3po left
14:12
tea3po joined,
tea3po left
14:13
ab5tract joined,
tea3po joined
14:24
xinming left
14:26
xinming joined
14:52
deoac joined
15:01
Sgeo joined
15:54
cm left,
cm joined
15:59
cm_ joined,
cm left
16:00
cm_ is now known as cm
16:06
cm left,
cm_ joined
16:07
cm_ is now known as cm
16:08
simcop2387 joined
16:09
simcop2387 left
16:16
cm left
16:17
cm joined
16:22
japhb left,
cm left,
cm joined
16:26
japhb joined
16:30
simcop2387 joined
16:32
perlbot joined
16:33
cm_ joined
16:34
cm left,
cm_ is now known as cm
16:37
jgaz left
16:38
cm_ joined,
cm left,
cm_ is now known as cm
16:39
dakkar left
16:44
jpn left
17:00
jpn joined
17:13
ab5tract left
|
|||
tonyo | uzl[m]: raku.land/zef:tony-o/Event::Emitter | 17:22 | |
m: use Event::Emitter; | 17:23 | ||
camelia | ===SORRY!=== Error while compiling <tmp> Could not find Event::Emitter in: /home/camelia/.raku /home/camelia/rakudo-m-inst-1/share/perl6/site /home/camelia/rakudo-m-inst-1/share/perl6/vendor /home/camelia/rakudo-m-inst-… |
||
tonyo | gist.github.com/tonyooooooo/8f0d8f...86b79a0d68 | 17:25 | |
uzl[m]: ^ | |||
otherwise you can do what ugexe did and do the serialization in the .emit() and deserialization/routing all within a tap | 17:26 | ||
ugexe | i suppose it could be done a little cleaner with supply and react blocks, since i dont think it would require a `once { ... }` (just put that logic inside the react block) | 17:30 | |
17:36
jpn left
17:45
jpn joined
17:58
jgaz joined
18:00
reportable6 left
18:03
reportable6 joined
18:06
jpn left
18:15
jgaz left
|
|||
tonyo | the 'start' thing in that js code isn't a once equiv though, it'll get run any time something emits a `start` and not when the event emitter receives its first message or starts listening | 18:21 | |
using a class or hash would allow for the value | 18:23 | ||
anton: i'm not sure how to reproduce the issue with fez you were seeing, i've tarred (in random order) and untarred it using system tar several 1000 times now with no error..do you happen to be using osx and the repo is on a network share? | 18:27 | ||
same with the other two tars that were causing issues | 18:28 | ||
18:30
sena_kun left,
deoac left
18:31
sena_kun joined
18:51
jpn joined
18:57
jpn left
19:00
jpn joined
19:08
rf joined
19:27
ab5tract joined
19:54
ab5tract left
20:18
jpn left
20:50
japhb left
20:54
japhb joined
20:56
jpn joined
21:01
jpn left
21:14
sarna left
21:20
orylesor joined
21:27
sarna joined
21:39
sena_kun left
22:38
orylesor left
22:45
jpn joined
22:49
jpn left
23:39
andinus left
23:40
jpn joined
23:45
jpn left
|