»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
00:07 dolmen left 00:09 nepugia left, lucasb left 00:14 Sgeo_ joined 00:16 jaldhar joined 00:17 Sgeo left 00:19 aborazmeh joined, aborazmeh left, aborazmeh joined 00:24 empee0 left
Xliff I am actually surprised at the WSL. It's near perfect compatibility. 00:35
That compatibility drops severely when dealing with GUI apps, though it is usable in most cases.
Windows doesn't want GTK "competing" with them on their own desktop. *snark*
00:57 Cabanossi left 01:07 Cabanoss- joined
Kaiepi must be better than it was when i tried it a few years ago 01:07
Xliff Ubuntu installs clean, rakudobrew works right out of the box.
Getting zef and modules working is a matter of the right packages. 01:08
Kaiepi ran into a really bizarre bug while writing ipc and thought it was an issue with node.js but nope, it was with wsl 01:09
never write ipc in node.js btw it'll make you want to tear your hair out
especially if it's between programs written in other languages 01:10
timotimo any way to use something like messagepack to make it less terrible? 01:21
01:32 noisegul_ joined 01:35 noisegul left
Kaiepi timotimo, i think the problem is languages that use libuv vs those that don't 02:01
i was writing ipc between a node program and a go program and the go program would receive messages in full but the node program wouldn't, so i had to buffer it manually in node 02:02
different internal buffer sizes
02:08 leah2 joined
ugexe was the go program using async like the node program? 02:08
Kaiepi i'm not entirely sure, go's a bit weird 02:14
02:14 hobbs left
Kaiepi well 02:15
it was async but the connection itself might not have been
i haven't looked through go's source code very much
02:18 hobbs joined, hobbs left, hobbs joined 02:41 noisegul_ is now known as noisegul 02:43 khisanth_ left 02:48 mowcat left 02:52 telex left 02:59 khisanth_ joined 03:08 telex joined 03:15 kaare__ left, aborazmeh left, kaare__ joined 03:52 PotatoGim joined 03:55 grayrider joined 03:56 grayrider left 04:09 aindilis joined 04:34 telex left 04:36 guifa2 joined 04:42 telex joined 04:47 ufobat left 04:57 guifa2 left, guifa2 joined
guifa2 p6: sub bar($a,$b) { say $b }; sub foo ($a) { &bar.assuming($a) }; foo(1) 2 04:58
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3b foo ($a) { &bar.assuming($a) }; foo(1)7⏏5 2
expecting any of:
infix
infix stopper
statement end
statemen…
05:00 cgfbee joined 05:07 telex left 05:15 telex joined 05:20 telex left 05:21 guifa2 left 05:22 Sgeo_ left, Sgeo_ joined 05:28 telex joined 05:31 sauvin joined 06:22 Sgeo_ left, Sgeo_ joined 06:43 cpan-p6 left 06:44 dolmen joined 06:46 reach_satori left 06:51 cpan-p6 joined, cpan-p6 left, cpan-p6 joined 07:06 reach_satori joined 07:11 domidumont joined 07:21 nepugia joined, patrickb joined
Geth doc: antoniogamiz self-assigned Indexing rules github.com/perl6/doc/issues/2575
a8e92ae333 | (JJ Merelo)++ | 10 files
07:24
07:30 zakharyas joined 07:45 dakkar joined 07:56 reach_satori left 08:01 dolmen left 08:05 rindolf joined
woolfy The Ballad of Perl - by Stephen Scaffidi : www.facebook.com/groups/perl6/perm...813241464/ 08:05
08:18 netrino__ joined
El_Che hey woolfy 08:22
08:33 dolmen joined 08:45 squashable6 left 08:48 squashable6 joined, ChanServ sets mode: +v squashable6 09:02 dolmen left 09:25 sno left 09:27 Black_Ribbon left, sno joined 09:43 dolmen joined 09:46 jaldhar left, jaldhar joined 09:48 kensanata joined
lizmat weekly: www.facebook.com/groups/perl6/perm...813241464/ 09:55
notable6 lizmat, Noted!
lizmat clickbaits p6weekly.wordpress.com/2019/06/24/...-toolsets/
09:55 bbkr joined 09:57 dolmen left 10:01 dolmen joined 10:06 domidumont left 10:14 dolmen left 10:18 leah2 left 10:27 kensanata left 10:35 leah2 joined 10:39 gfldex joined 10:45 empee0 joined, empee0 left 10:47 empee0 joined 10:48 cpan-p6 left 10:49 cpan-p6 joined, cpan-p6 left, cpan-p6 joined 10:57 mniip joined 11:20 empee0 left 11:26 grumble joined 11:34 KotH joined 11:35 leah2 left 11:45 ravenousmoose left 11:46 ravenousmoose joined 11:51 leah2 joined 11:55 domidumont joined 12:01 zakharyas left 12:04 dolmen joined 12:06 guifa2 joined 12:28 squashable6 left 12:31 squashable6 joined 12:32 dolmen left 12:35 guifa2 left, guifa2 joined, dolmen joined 12:38 JustBrowsing joined, mahafyi joined 12:39 JustBrowsing left 12:42 ravenousmoose left 12:49 ravenousmoose joined 12:51 kensanata joined, kensanata left 12:52 squashable6 left 12:55 squashable6 joined, zakharyas joined 13:22 antoniogamiz joined 13:34 guifa2 left 13:35 candr joined
candr What is the right way to stop an async thread in an infinite loop. The thread was started with `start foo()`. 13:38
jnthn Create a Promise like `my $cancel = Promise.new`, rewrite the infinite loop to `until $cancel { ... }`, and then .keep (or .break if you want an error) the Promise to stop it 13:39
Probably changing it to `start foo($cancel)` to pass the Promise in to the code with the loop 13:40
candr Ah ok. Thanks jnthn! 13:41
13:42 candr left
antoniogamiz why zef is not found if I'm root? 13:43
timotimo it's probably installed to your user's home 13:44
if not, it's probably only put in your user's $PATH shell environment variable 13:45
13:46 sena_kun joined
tadzik or both :) 13:46
timotimo ohai tadzik 13:48
13:48 telex left
tadzik hai o/ 13:48
angular compilation times take soo long that I switched windows to check IRC and now I forgot what bug I was trying to fix :| 13:50
13:50 candr joined
timotimo angular, eh? you're working on angular itself? 13:51
tadzik no, just an angular app 13:52
timotimo was it typescript that angular uses? or livescript? or something like that?
candr jnthn: will the $cancel promise .keep when it goes out of scope by any chance? Or do i have to be explicit with the .keep to clean up the thread with the loop?
tadzik it's typescript, yes
timotimo candr: it won't do such a thing by itself, but you can use "will LEAVE" for that purpose 13:53
tadzik it's lovely for what it is, but it's also infuriating how many things it doesn't catch, or how many things obviously can't work because javascript so what did you expect, you fool
candr ok.. I ill look that up
thanks again
13:54 louisono joined, pamplemousse joined
kawaii If I have a class with a couple of multi methods, do they both need `is export`'ing to use them in other places? 13:58
Or do classes not need their methods exporting at all?
moritz "is export" doesn't make too much sense on methods 14:00
antoniogamiz use unit class and with that is enough :D 14:01
moritz I think the idea was that it creates a sub as well, but usually you want more control over the signature when you offer sub variants
14:03 telex joined 14:06 antoniog1miz joined, antoniogamiz left 14:10 Ralyer joined
discord6 <Vendethiel> ohai 14:20
kawaii having some issues when calling my multis www.irccloud.com/pastebin/giLLltSC/ 14:21
`$perspective.submit($message.content);` is how I call the multi
www.irccloud.com/pastebin/SNLchdAF/
but no signatures ever match
discord6 <Vendethiel> Seems like $perspective is a type object? 14:24
kawaii Vendethiel: `my $perspective = Rose::ContentAnalysis::Perspective;` 14:25
discord6 <Vendethiel> .new?
kawaii oh ouch maybe
hmm I think .new might be implied? since I get the same error 14:26
discord6 <Vendethiel> It’s not
<Vendethiel> Does the caller still say :U:?
14:26 pamplemousse left
kawaii `Cannot resolve caller AUTOGEN(Rose::ContentAnalysis::Perspective:D: :message(Str)); ` 14:26
14:26 pamplemousse joined
discord6 <Vendethiel> Message need to be pssed by name 14:27
<Vendethiel> Since your signature has Str :$message
kawaii `$perspective.submit(:message($message.content));`
this too, does not work :(
discord6 <Vendethiel> Oh you changed it
<Vendethiel> Add a ! in both signatures for :$message and the other one 14:28
<Vendethiel> Otherwise they’re optional in both
kawaii oh like `:$message!`?
discord6 <Vendethiel> Yeah 14:29
kawaii www.irccloud.com/pastebin/S56D7tFW/
hm, seems the same :(
timotimo what's the reason for AUTOGEN to be mentioned again? 14:30
i forgot when it shows up
maybe it'll help if there's an explicit proto method declaration in that class 14:31
14:31 cpan-p6 left, cpan-p6 joined, cpan-p6 left, cpan-p6 joined 14:32 meylor joined, meylor left 14:33 meylor joined
kawaii timotimo: would you be able to elaborate on that please? :) have not used multis before today 14:34
lizmat kawaii: docs.perl6.org/language/functions#...i-dispatch 14:36
kawaii So, I'm passing a variable called $message, so I'm not sure why it's not matching that method immediately
since the @models has a default anyway, and is not mandatory 14:37
14:37 molaf joined
kawaii wait maybe $message is not a string, I'd better check 🤔 14:37
timotimo for a start, you can try "proto method blahblah(|) {*}"
kawaii I did a `dd $message.content;` and got back `"hello"` so yeah it's a Str 14:38
timotimo: so the only commonalities between my `submit` multies is the @models param, so `proto submit(MODEL :@models, |) {*}` ? 14:40
timotimo i'd recommend just putting | for now 14:42
kawaii www.irccloud.com/pastebin/RLm7cDE1/ 14:43
hm, no notable difference
14:44 candr left, Ralyer left, antoniogamiz joined 14:45 meylor left 14:47 antoniog1miz left
kawaii so it doesn't look like I can used named arguments as distinguishing characteristics timotimo? 14:51
it looks like I should be able to from the documentation, but seemingly not working here
14:55 meylor joined 14:56 lucasb joined
timotimo you can, but especially if they are optional, they won't change a match that already works without it 15:02
and all methods have an "accept any named arguments" thing set up by default
15:03 candr joined
kawaii timotimo: so I'm right in thinking `$perspective.submit(:message($message.content));` WILL create a named argument == `:$message`? 15:03
15:05 empee0 joined
antoniogamiz I think so 15:07
mmm though maybe that creates an alias, I'm not sure 15:08
timotimo it's supposed to
kawaii I tried `$perspective.submit($message => $message.content);` too but nothing 15:10
antoniogamiz it should be without $
message => $message.content
kawaii same issue :( 15:11
it never matches any of the signatures
antoniogamiz mmm send the code pls 15:12
kawaii one moment!
antoniogamiz (sorry if have already sent it, I did not see it=
kawaii antoniogamiz: gist.github.com/kawaii/107493f0328...8f814f91e0 15:13
antoniogamiz mmm what is the purpose of a * in a signature? for instance: sub a(*@blocks){ 15:14
kawaii Ah that was the proto method stuff that timotimo suggested
antoniogamiz kawaii: that is a dude of mine, not related to your code
kawaii: I'm going to take a look at it, one moment 15:15
kawaii ah right :)
antoniogamiz have you checked if $message.content is actually a Str? 15:16
put say $message.content.^mro; before $perspective.submit
kawaii antoniogamiz: `((Str) (Cool) (Any) (Mu))` 15:17
Looks fine
antoniogamiz mmm it should match then, it's weird 15:18
kawaii I even removed the `Str` requirement from the method, still nothing 15:24
antoniogamiz uoh if you change $name to $message it works 15:25
but I suppose that you dont want that solution
kawaii not really, they are different methods because they are going to analyse different data and perform different actions :)
I just thought a multi would be cool 15:26
antoniogamiz it looks like it gets confused if you use them like that :/
kawaii I was under the impression the way I was using them was the exact intended purpose :P 15:28
antoniogamiz maybe it's a bug, try asking in stackoverflow
I have tried to fix it but I dont know what else to do :( 15:29
15:31 patx64 joined
kawaii maybe one of the wizards like jnthn might know :) 15:36
15:36 mowcat joined
patx64 Hi everyone, I volunteered to take on porting Unicode::UCD. I realized that uniprop is already built into P6 strings. Is there any point to this module? What value could I add? Should they rather be a built-in instead of a separate module? here's my pastebin: pastebin.com/sXVPiLGp 15:36
15:39 meylor left, meylor joined, meylor left 15:40 meylor joined
lizmat patx64: afaik, the JVM and Javascript backends do not have that functionality... 15:40
so for those backends, it makes sense I think
15:42 natrys joined
timotimo i think there's still stuff for other languages that uniprop doesn't cover 15:42
patx64 lizmat: thank you for pointing that out, I am testing on rakudo star and didn't realize the other backends would not have those features. Is it fair to say Str.uni* (uniname, uniprop, and friends) are Rakudo specific?
15:42 meylor left 15:43 meylor joined
lizmat the other backends are also Rakudo, you could say they are MoarVM specific atm 15:43
jnthn They're part of the Perl 6 language spec, though
So other backends really should provide them eventually
patx64 timotimo: do you have an example or perhaps github issue # for that? 15:44
jnthn The question is more if there's parts of the UCD we know we *don't* want to have built-in. We've not touched unihan for example, and maybe that's out of scope for the core and thus should be in a module?
15:44 pamplemousse left
timotimo not really, i think it's mostly stuff like "uppercase i must turn into uppercase I with a dot on top if the locale is turkish" stuff? 15:44
patx64 jnthn: that's what I thought too. lizmat: I see, thanks for clarifying 15:45
15:45 pamplemousse joined
kawaii antoniogamiz: I phrased it badly but I posted here: stackoverflow.com/questions/567577...-signature 15:46
antoniogamiz kawaii: good! let's see if someone knows what's going on 15:47
15:47 meylor left
kawaii I spent the last hour debugging this so I hope so :( 15:48
antoniogamiz you should add the other definition of submit+
15:50 accargh joined
kawaii antoniogamiz: done :) 15:51
15:51 candr left 15:54 accargh left
kawaii jnthn: I have replied to your comment :) 15:56
15:57 MasterDuke left 16:01 patx64 left 16:03 nepugia left
jnthn kawaii: I answered :) 16:03
kawaii jnthn: you solved it! I'll mark as correct when SO allows me to 16:04
thank you so much
jnthn Welcome :) 16:05
Geth ¦ problem-solving: AlexDaniel assigned to jnthn Issue Ambiguity in slicing with Ranges / WhateverCodes github.com/perl6/problem-solving/issues/50
16:10 netrino__ left 16:11 Ralyer joined 16:19 nepugia joined, patrickb left 16:23 ravenousmoose left 16:24 dolmen left 16:25 kiwi_37 joined 16:27 dolmen joined 16:36 vrurg joined 16:37 MasterDuke joined
kawaii jnthn: I have a follow-up question if you have a few moments please? :) 16:40
jnthn kawaii: Sort of :) 16:41
kawaii It occurs to me that I should probably be passing the entire `$message` object into the `Perspective` class so that if the code determines the message is bad, the extra data contained within the object (such as message ID, and user ID) can be passed over to an `::Actions` class - which would then contain methods to ban, kick a user.
16:42 Ralyer left
kawaii If I call the submit routine from my script like `$perspective.submit($message);` so that the entire object is passed in, where can I then tell my `submit` method _which part_ of the object is the 'message'? 16:43
(as opposed to only passing in `$message.content` and assigning the value of it to `$message` in the class
Sorry for the poor wording of this, I am still getting used to OOP ways of doing things :) 16:44
Can I do `$perspective.submit($message);` and then `multi method submit(Str :$message.content!,` directly?
is the compiler clever enough to figure this out? 16:45
jnthn No
Doesn't even get past the parser. But!
You can use signatures recursivley to destructure an object
multi method submit((Str :$content, *%)) { }
Note the extra level of parens 16:46
If all your messages inherit a base class or (preferably perhaps) do a role in common, you can do
16:46 dolmen left
jnthn multi method submit(Message (Str :$content, *%)) { } 16:46
Where Message is that base type
If you want the whole message as well as the pieces, then you'd do
multi method submit(Message $m (Str :$content, *%)) { }
kawaii ahhhh okay that sounds like it might work, something like `multi method submit(Message (Str :$content!, *%),MODEL :@models = Array[MODEL](SEVERE_TOXICITY))` ? 16:47
jnthn Effectively, the inner signature is bound against object attributes. In fact, it calls .Capture on your object, which by default will produce a Capture with named arguments for every public attribute.
Yes, something like that
Note that you can also override method Capture on any object to control how it will destructure in a signature. I've not seen people use this feature much. :) 16:48
(Maybe 'cus the default is usually good enough)
kawaii There is much testing to be done! Thank you for your help once again! :)
jnthn Welcome, have fun :) 16:49
16:50 ravenousmoose joined 16:51 dakkar left
kawaii jnthn: so this turned out to work really well `multi method submit((Str :$content, *%)`, so here we've passed in `$message`, the entire object and bisected the content out of it, but what did we do with the rest? What if I want to access `$message.author.id` for example? Or did we simply discard the rest upon entry into the method? 16:55
16:55 ravenousmoose left, domidumont left
jnthn The *% means "and throw away the rest2 16:56
The *% means "and throw away the rest"
So you could put more things there
kawaii i.e. `$author.id`? I assume I just chop off the `$message.` part
jnthn Well, .author is one level and .id is another 16:57
So you'd need another level of signature to unpack that :)
kawaii Gotcha :)
jnthn (You can nest signatures as deeply as you'd want) 16:58
17:07 hythm_ joined 17:08 Ralyer joined 17:09 Ralyer left 17:12 hythm_ left 17:13 hythm joined 17:16 patrickb joined 17:17 squashable6 left, jmerelo joined, squashable6 joined
jmerelo Wow, all this web interface has changed. Not so sure I like it better 17:18
releasable6: status
releasable6 jmerelo, Next release will happen when it's ready. 6 blockers. 262 out of 660 commits logged (⚠ 1 warnings)
jmerelo, Details: gist.github.com/4ac1d8bfdc3f254240...5a64ec67da
17:20 jmerelo left 17:22 wamiks joined
doc: 30516acd3c | (JJ Merelo)++ | doc/Type/X/Control.pod6
Clarifies X::Control, refs #2871
synopsebot_ Link: doc.perl6.org/type/X::Control
17:33 kiwi_37 left 17:36 wamiks left 17:42 zakharyas left 17:45 AlexDaniel joined, jaldhar left 17:56 pecastro joined 17:57 [Sno] joined 18:00 sno left
TreyHarris In POD6 (and more importantly, on docs.perl6.org), does X<> create an invisible anchor I can link to? I want to link to a particular code example in a different section of the same doc. (It's in control.pod6, so I don't think I need to worry about the link getting separated from the target like you might with routines.) I could try it, but building the docs on my tiny machine takes (literally) hours. 18:02
(Or is this for #perl6-dev?)
antoniogamiz an invisible anchor?
18:04 leah2 left
TreyHarris antoniogamiz: Yes, as in pre-HTML5 `<a name=foo/>...<a href="#foo">linkback</a>` or HTML5 `<ELEMENT id="#foo">...<a href="#foo">linkback</a>` 18:05
antoniogamiz github.com/perl6/Pod-To-HTML/blob/...ML.pm#L562 18:07
TreyHarris antoniogamiz: thanks! 18:10
18:13 patrickb left 18:20 leah2 joined 18:27 meylor joined 18:31 sauvin left 18:33 meylor left, meylor joined
Geth ecosystem/PodUtilities: a9d5665612 | Antonio++ (committed using GitHub Web editor) | META.list
Update META.list
18:33
18:40 meylor left 18:42 empee0 left 18:48 antoniogamiz left, louisono left 18:51 empee0 joined 18:57 molaf left, zakharyas joined 19:09 Woodi joined 19:23 zakharyas left 19:26 nepugia left 19:32 wamiks joined 19:35 mowcat left
kawaii sena_kun: hm, I seem unable to post the emoji '🙂' in Comma, yet it works fine in my shell, and in Perl 6, any idea why? 20:00
other emojis seem to work fine
lizmat m: say "🙂".uninames 20:01
camelia (SLIGHTLY SMILING FACE)
ugexe m: BEGIN my $self = $*REPO.resolve(CompUnit::DependencySpecification.new(:short-name<Test>)); say $self.distribution; class Test:ver($self.distribution.meta<ver>):auth($self.distribution.meta<auth>) { }; say Test.^ver; 20:03
camelia CompUnit::Repository::Installation::LazyDistribution.new(dist-id => "E14CAA5C7DE5B1A1BAC1ED1155377A9AF4962C18", read-dist => -> $_ { #`(Block|83508328) ... }, meta => ${:api(v0), :auth("perl"), :checksum("A9237DAD0B4486CFFDE585129745545FCEE0D02C"), :s…
ugexe m: BEGIN my $self = $*REPO.resolve(CompUnit::DependencySpecification.new(:short-name<Test>)); class Test:ver($self.distribution.meta<ver>):auth($self.distribution.meta<auth>) { }; say Test.^ver;
camelia v6.d
ugexe someone should automate this
sena_kun kawaii, what do you mean by "unable to post"? I can copy-paste it and it looks like a rectangle(well, the font issue). 20:04
kawaii sena_kun: I mean paste, yes, it doesn't show up at all in my comma, not even a box
weird, oh well I can just use vim to edit this file
sena_kun OS?
not Mac, I hope?
20:05 leah2 left
kawaii Ubuntu 20:05
sena_kun hmmm....
m: '🙂'.uninames.say
camelia (SLIGHTLY SMILING FACE)
sena_kun sorry, cannot reproduce
20:06 molaf joined
sena_kun I can paste it using both X and normal clipboard 20:07
ugexe what about stand-alone editor vs intellij plugin 20:08
sena_kun I tried it in idea too to check if it might be a platform issue, but the result is the same. 20:09
kawaii weird, oh well! 20:12
sena_kun you can try to avoid emoji: if ascii smiles are too little, use a reaction macro image, if a reaction macro image is too much for the case, use ascii smiles. :p 20:14
kawaii hey this is perl 6 don't try and stop me using emojis in my method names :P 20:15
timotimo 20:16
sena_kun m: sub slightly-smiled-face {}; slightly-smiled-face; 20:17
camelia ( no output )
sena_kun see, it's almost the same!
20:21 leah2 joined 20:22 nepugia joined 20:23 nepugia left, nepugia joined
kawaii I assume DBIish is still the defacto way to do 'database stuff' in P6? How mature is Red now? 20:31
ugexe there is the DB modules as well 20:32
sena_kun DB::Pg is nice, DBIish for sqlite, I'd say. 20:33
kawaii Using PostgreSQL 20:35
sena_kun going with DB::Pg is hard to overestimate if you want it to be certain. if you want to experiment... 20:38
20:42 kensanata joined
kawaii think I might give DB:Pg a whirl for this project 20:55
Curt's modules are always good :)
21:01 farcas82regreg joined 21:08 farcas82regreg left 21:10 sena_kun left 21:11 sena_kun joined, sena_kun left, empee0 left 21:18 dolmen joined 21:19 dolmen left, imhtrg joined
xinming Is it possible to make a "Capture" to check a passed hashref is desired? 21:25
21:25 squashable6 left, squashable6 joined, ChanServ sets mode: +v squashable6 21:26 pamplemousse left
xinming hmm, I just realized we may be able to create a nested capture. 21:28
Hmm, I mean signature, What I mean is, I created a function, where it receives config from hash, I need a way to validate the hash, I'm thinking wether use signature is good for this purpose. 21:33
jnthn xinming: Well, using JSON::Schema (which really just takes any hash/array-like data structure) is also a possible way 21:34
But it could be possible with sigs too 21:35
xinming I'm playing with signature stuff
BTW, is it possible to replace the signature for the sub? 21:36
What I mean is, how can signature be programmly used instead of just validating params for subs. 21:37
jnthn It can't.
You can have signature literals separate from subs
And use them for destructuring 21:38
In principle you can have a signature literal stashed in a variable and use that in a `where` clause, which I guess would let you "change the signature"
But you can't change the "real" signature, since it's actually compiled into bytecode of the sub in most cases 21:39
21:44 kensanata left 21:45 hythm left
xinming Thanks for the explanation. 21:45
how do we validate the "nested" hash with signautre. :-) 21:46
21:47 guifa left 21:48 dogbert11 joined 21:49 guifa joined 21:50 krunen joined, dogbert17 left
jnthn m: my %h = a => { b => 42 }; say %h ~~ :(:a((:$b where 42))) 21:53
camelia True
jnthn m: my %h = a => { b => 42 }; say %h ~~ :(:a((:$b where 41)))
camelia False
jnthn xinming: ^^
xinming Thanks, I thought about nested signatured, But I never succeed 21:56
22:01 reach_satori joined 22:23 Black_Ribbon joined 22:26 wamiks left 22:27 natrys left, Black_Ribbon left 22:28 Black_Ribbon joined 22:35 tobs joined 22:53 pamplemousse joined 22:55 lucasb left 22:56 farcas82regreg joined
kawaii I don't suppose any perl 6 regex wizards are online at this time? :) 23:01
23:04 mahafyi left, mahafyi joined
jnthn kawaii: I wrote chunks of the regex compiler, though I'm not sure if that makes me a wizard or just crazy :P 23:06
23:08 giraffe joined
kawaii jnthn: little bit of both maybe? :) I have an array of @badwords, and then a $content variable which is submitted to a not-so-clever AI, it does not always detect use of profanity if the words are joined. So if I have `my @badwords = 'fizz', 'buzz';` and `my $message = "this is a fizzbuzz";` how I can use `split()` to add a space between around each detected `badword` if it doesn't alreay have one? 23:09
hope that made sense :)
23:09 dolmen joined, rindolf left
kawaii i.e. we mutate the $content variable into "this is a fizz buzz" so it can be resubmitted to the AI for anaysis 23:09
jnthn I think subst is maybe more suitable than split... 23:10
Maybe something like $message.subst(/(@badwords)(@badwords)/, { "$0 $1" }, :g) 23:11
kawaii oooo okay so the badwords array is my matcher
that makes sense
I'll give that a shot
23:13 squashable6 left
kawaii hm, no dice 23:14
jnthn m: my @bad = 'water', 'melon'; say "I eated a watermelon".subst(/(@bad)(@bad)/, { "$0 $1" }, :g) 23:17
camelia I eated a water melon
jnthn Hm, it works in that small case
I should add this may not be fast at all...
23:18 squashable6 joined, ChanServ sets mode: +v squashable6
jnthn m: my @bad = 'water', 'melon'; say "I eated a melonwater".subst(/(@bad)(@bad)/, { "$0 $1" }, :g) 23:18
camelia I eated a melon water
23:20 imhtrg left
kawaii jnthn: ah right I see, in your case two bad words exist next to one another, but the word `tastymelon` would not be bisected 23:20
sorry if I was not clear enough in my example 23:21
jnthn Oh! 23:22
23:22 dolmen left
jnthn This is totally heading for a buttbuttin listening to clbuttic music, isn't it... :P 23:23
kawaii :P 23:25
jnthn m: my @bad = 'water', 'melon'; say "I eated a tastymelon waterbeer".subst(/$<a>=\w$<b>=@bad | $<a>=@bad$<b>=\w /, { "$<a> $<b>" }, :g) # maybe this
camelia I eated a tasty melon water beer
kawaii jnthn: hey that works perfectly, thank you :) 23:30
jnthn Nice :) 23:35
Meanwhile, I've almost got most of the missing bits of Cro::WebApp::Template implemented, so can release that properly soon :)
discord6 <Vendethiel> \o/ 23:37
23:40 pamplemousse left 23:42 pecastro left 23:48 nepugia left