🦋 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:06
reportable6 left
00:07
reportable6 joined
00:18
discord-raku-bot left
00:19
discord-raku-bot joined
00:40
derpydoo left
00:41
Kaipei left
00:52
ToddAndMargo joined
|
|||
ToddAndMargo | Any chanced in the future of you guys allowing me to declare more than one thing returned on the sub declaration? Sort of like `sub FolderSize( Str $FolderPath --> Int, Str) {` | 00:53 | |
Maybe I just don't know how? | |||
01:10
rba left,
broquaint left,
tinita left,
hexology left,
dustinm` left,
rba joined
01:11
hexology joined
01:20
[Coke]__ joined,
[Coke] left
01:26
dustinm` joined
01:36
habere-et-disper joined
01:46
Guest66 joined
01:47
Guest66 left
|
|||
vrurg | ToddAndMargo: look for subset in the docs | 01:49 | |
01:50
perlbot left,
simcop2387 left
01:52
derpydoo joined
01:58
perlbot joined
01:59
simcop2387 joined
02:03
frost75 joined
02:04
deoac joined
|
|||
ToddAndMargo | I looked up subset. Could not figure out what you meant. I am returning an integer and a string | 02:14 | |
02:25
silug left,
silug joined
02:38
frost75 left
02:44
habere-et-disper left
02:47
bigdata joined,
bigdata left
02:50
ToddAndMargo left
03:05
derpydoo left
03:16
deoac left
04:16
reportable6 left,
committable6 left,
notable6 left,
benchable6 left,
bloatable6 left,
tellable6 left,
nativecallable6 left,
sourceable6 left,
linkable6 left,
shareable6 left,
greppable6 left,
coverable6 left,
quotable6 left,
releasable6 left,
evalable6 left,
bisectable6 left,
squashable6 left,
statisfiable6 left,
unicodable6 left
04:17
shareable6 joined,
nativecallable6 joined,
reportable6 joined,
statisfiable6 joined,
notable6 joined,
quotable6 joined
04:18
sourceable6 joined,
coverable6 joined,
greppable6 joined,
benchable6 joined,
tellable6 joined,
bisectable6 joined,
bloatable6 joined,
committable6 joined
04:19
evalable6 joined,
releasable6 joined,
squashable6 joined,
linkable6 joined,
unicodable6 joined
04:31
discord-raku-bot left
04:35
HvszrStykp left
05:11
discord-raku-bot joined
05:15
discord-raku-bot left
05:34
discord-raku-bot joined
05:37
discord-raku-bot left
05:40
discord-raku-bot joined
05:46
Abhoerschutz left,
Abhoerschutz joined
05:52
abraxxa joined
05:56
abraxxa left,
abraxxa joined
06:00
djerius left
06:02
djerius joined
06:06
reportable6 left
06:07
reportable6 joined
06:48
Sgeo left
07:14
squashable6 left
07:16
squashable6 joined,
labster joined
|
|||
Nemokosch | So you are returning a tuple? | 07:18 | |
07:45
sena_kun joined
07:48
Kaipei joined
07:49
lichtkind joined
08:08
tinita joined
08:15
dakkar joined
08:24
sftp left
08:25
sftp joined
08:36
Manifest0 left
08:43
haxxelotto left
08:46
haxxelotto joined
|
|||
Is there a way to tell a regex (or a grammar) "match any _permutation_ of these terms?" | 09:45 | ||
09:46
evalable6 left,
linkable6 left
09:47
linkable6 joined
09:48
evalable6 joined
|
|||
guifa | Nemokosch: if they can be in any order AND any number, [<a><b><c>]* | 10:30 | |
tellable6 | guifa, I'll pass your message to Nemokosch | ||
guifa | if must be exactly 1 | ||
m: my $r = /[$<a>=a|$<b>=b|$<c>=c]* <?{$/<a b c>».elems.all == 1}> /; say so 'abc' ~~ $r; say so 'bac' ~~ $r; say so 'ba' ~~ $r; say so 'abbc' ~~$r; | |||
camelia | True True False False |
||
Nemokosch | yeah rather the latter, thanks | 10:33 | |
10:34
Kaipei left
|
|||
guifa | if your token is nothing more than the permutations, you could probably say something like (untested) $/.kv.grep(*.value.elems == 1) == $/.keys and you wouldn't need to update for each element in the list | 10:38 | |
guifa is afk | |||
10:52
labster left
10:56
Kaipei joined
|
|||
Geth | advent: massa++ created pull request #95: Update authors.md |
11:19 | |
11:29
sena_kun left
|
|||
Geth | advent: 0f7f156d28 | (Humberto Massa)++ (committed using GitHub Web editor) | raku-advent-2022/authors.md Update authors.md |
11:51 | |
advent: 87ff772234 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | raku-advent-2022/authors.md Merge pull request #95 from massa/patch-2 Update authors.md |
|||
12:07
reportable6 left
12:08
reportable6 joined
12:32
Kaipei left
12:41
Kaiepi joined
|
|||
SmokeMachine | m: my @elems = <a b c>.permutations.map: *.join; say "cab" ~~ /^ @elems $/ | 12:43 | |
camelia | 「cab」 | ||
12:49
derpydoo joined
|
|||
Nemokosch | this would explode pretty soon, right? | 12:50 | |
13:34
Sgeo joined
13:59
MasterDuke joined
14:12
derpydoo left
14:56
abraxxa left
15:01
jgaz joined
15:15
deoac joined
15:21
HvszrStykp joined
15:39
deoac left
15:51
lichtkind left
16:03
Kaiepi left
16:07
lichtkind joined
16:08
Kaiepi joined
16:30
simcop2387 left,
perlbot left
16:36
squashable6 left
16:38
squashable6 joined
16:39
donpdonp- joined,
ProperNoun left,
dakkar left,
tobs left
16:40
andinus` joined,
justache joined,
El_Che left,
lucs left,
jjatria left,
ProperNoun joined,
Maximus joined,
Some-body_ joined,
gabiruh_ left,
eseyman left,
Geth left,
JRaspass left,
tobs joined,
gabiruh joined
16:41
ilogger2 left,
donpdonp|z_ left,
andinus left,
sivoais left,
Zero_Dogg left,
DarthGandalf left,
Sevalecan left,
_________ left,
Scotteh left,
moritz left,
xkr47 left,
Maximus is now known as Sevalecan,
epony left,
mtj left,
Maylay left,
justHaunted left
16:42
El_Che joined,
xkr47 joined,
eseyman joined,
moritz joined,
sivoais joined,
epony joined
16:43
_________ joined,
Some-body_ is now known as DarthGandalf
16:44
Maylay joined
16:45
lucs joined
16:46
Scotteh joined
16:53
jjatria joined,
JRaspass joined,
mtj joined,
ilogger2 joined
16:54
Zero_Dogg joined
16:55
equinox joined
16:56
equinox left,
equinox joined
16:58
justache is now known as justHaunted
17:12
simcop2387 joined
17:13
perlbot joined
17:29
DarthGandalf left
17:30
DarthGandalf joined
18:07
reportable6 left
18:10
reportable6 joined
18:16
equinox left
18:20
MasterDuke left
18:34
slu joined
18:49
derpydoo joined
19:15
Xliff joined
|
|||
Xliff | \o | 19:15 | |
Is there a way to use a Promise (or some other method) to implement a timeout on a method call? | 19:16 | ||
19:19
equinox joined
|
|||
Xliff | m: my $colde = start { sleep 20; say "oops!" }; await Promise.in(2).then: { $code.break }; sleep 25; | 19:24 | |
camelia | ===SORRY!=== Error while compiling <tmp> Variable '$code' is not declared. Did you mean any of these: '$colde', 'Code'? at <tmp>:1 ------> "oops!" }; await Promise.in(2).then: { ⏏$code.break }; sleep 25; |
||
Xliff | m: my $code = start { sleep 20; say "oops!" }; await Promise.in(2).then: { $code.break }; sleep 25; | ||
camelia | An operation first awaited: in block <unit> at <tmp> line 1 Died with the exception: Access denied to keep/break this Promise; already vowed in block at <tmp> line 1 |
||
Xliff | m: my $code = start { sleep 20; say "oops!" }; my $v = $code.vow; await Promise.in(2).then: { $v.break }; sleep 25; | 19:25 | |
camelia | Access denied to keep/break this Promise; already vowed in block <unit> at <tmp> line 1 |
||
Xliff | m: my $code = start { sleep 20; say "oops!" }; await Promise.in(2).then: { $code.break }; sleep 25; | ||
camelia | An operation first awaited: in block <unit> at <tmp> line 1 Died with the exception: Access denied to keep/break this Promise; already vowed in block at <tmp> line 1 |
||
Xliff | ??? Since when? | ||
m: my $code = start { sleep 20; say "oops!" }; Promise.in(2).then: { $code.break }; sleep 25; | 19:26 | ||
camelia | (timeout)oops! | ||
Xliff | m: my $code = start { sleep 10; say "oops!" }; Promise.in(2).then: { $code.break; say "Broken" }; sleep 15; | 19:27 | |
camelia | oops! | ||
tonyo | Xliff: you can't break a start {} | ||
it'll leave that promise/code running and open if you time out that way | 19:28 | ||
Xliff | So how can I make the code block timeout. | ||
tonyo | are you running some long process in a loop or waiting on an external system in your start block? | ||
Xliff | Yep. | ||
tonyo | if a loop you can get away with a semaphore | ||
if an external system then you need a different mechanism | |||
Xliff | OK. What system would you recommend? | ||
Actually, I wonder if I am overthinking it.. .(probably) | 19:29 | ||
tonyo | what are you doing, specifically? | 19:30 | |
Xliff | Trying to get a JSON response from a webservice/ | 19:31 | |
tonyo | if you're doing a loop and the iterations are fairly short lived you can do: | ||
m: my @timeout = (Promise.in(1); start { for 1..100 { die "cancel" if @timeout[0].status ~~ PromiseStatus::Kept; sleep 1; }; say "complete"; "done"; }); await Promise.anyof(|@timeout); @timeout.map({ $_.status ~~ PromiseStatus::Planned && $_.vow.break("timeout") }); await Promise.allof(@timeout); dd @timeout.map({ try { $_.result } // $_.cause }); | 19:32 | ||
camelia | (Bool::True, X::AdHoc.new(payload => "cancel")).Seq | ||
Xliff | So instead of NYI, I just use the timeout mechanism provided... LOL | ||
tonyo | for a web request there should be some timeout mech | ||
haha yes | |||
Xliff | er... | ||
s/NYI/NIH/ | |||
lizmat clickbaits rakudoweekly.blog/2022/10/24/2022-43-cro-apper/ | 19:39 | ||
19:44
haxxelotto left
19:45
haxxelotto joined
19:58
Geth joined
20:00
haxxelotto left
20:11
jjido joined
20:20
haxxelotto joined
20:26
jjido left
20:30
haxxelotto left
20:50
epony left
20:51
epony joined
20:53
equinox left,
slu left
21:18
squashable6 left
21:19
squashable6 joined
21:22
lichtkind left
21:24
[Coke]__ left
21:33
derpydoo left
21:38
jgaz left
22:18
johnjaye left
22:20
johnjaye joined
22:48
Guest95 joined
22:50
Guest95 left
22:54
epony left
23:54
committable6 left,
bloatable6 left,
nativecallable6 left,
notable6 left,
quotable6 left,
shareable6 left,
evalable6 left,
bisectable6 left,
benchable6 left,
statisfiable6 left,
greppable6 left,
unicodable6 left,
squashable6 left,
reportable6 left,
tellable6 left,
sourceable6 left,
coverable6 left,
linkable6 left,
releasable6 left,
notable6 joined
23:55
committable6 joined,
sourceable6 joined,
shareable6 joined,
squashable6 joined
23:56
greppable6 joined,
evalable6 joined,
linkable6 joined,
releasable6 joined,
quotable6 joined,
bloatable6 joined,
benchable6 joined,
reportable6 joined
23:57
bisectable6 joined,
coverable6 joined,
tellable6 joined,
nativecallable6 joined,
statisfiable6 joined,
unicodable6 joined
|