»ö« 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:01 pecastro left 00:12 w_richard_w joined 00:20 ryn1x left 00:33 tyil left 00:39 tyil joined 00:44 Sgeo joined 00:48 ryn1x joined 00:49 telex left 00:51 telex joined 01:00 zachk left
timotimo wanna build a role that i can stash into enums that'll let me TheEnum(MemberOne, MemberTwo, MemberThree) and it'll +| them, but maybe i also want to allow TheEnum(:MemberOne, :MemberTwo) 01:01
thoughts?
it'll have the benefit of putting the name of the enum there so you can't get confused
like, what are TIMER, AUDIO, VIDEO, JOYSTICK, ... supposed to mean? oh, they're for SDL_INIT!
discord6 <Rogue> that sounds nice 01:02
<Rogue> I personally already use the enum's name when I use enums
timotimo instead of having to write TIMER +| AUDIO or SDL_INIT::TIMER +| SDL_INIT::AUDIO +| ...
discord6 <Rogue> Yeah, that does sound nice
timotimo it'll be trivial to write, but i want it to use generated code so it can be Very Fast 01:03
01:13 markoong left, markoong joined 01:19 markoong left
discord6 <timotimo> multi method CALL-ME(*@vals, :$JOYSTICK = 0, :$EVENTS = 0, :$TIMER = 0, :$NOPARACHUTE = 0, :$GAMECONTROLLER = 0, :$VIDEO = 0, :$HAPTIC = 0, :$AUDIO = 0) { @vals.reduce(&infix:<+|>) +| $JOYSTICK +| $EVENTS +| $TIMER +| $NOPARACHUTE +| $GAMECONTROLLER +| $VIDEO +| $HAPTIC +| $AUDIO; } 01:30
timotimo oh, not quite
discord6 <timotimo> multi method CALL-ME(*@vals, :$OPENGL = 0, :$MAXIMIZED = 0, :$INPUT_FOCUS = 0, :$MOUSE_FOCUS = 0, :$INPUT_GRABBED = 0, :$RESIZABLE = 0, :$FOREIGN = 0, :$FULLSCREEN_DESKTOP = 0, :$SHOWN = 0, :$FULLSCREEN = 0, :$MINIMIZED = 0, :$HIDDEN = 0, :$ALLOW_HIGHDPI = 0, :$MOUSE_CAPTURE = 0, :$BORDERLESS = 0) { @vals.reduce(&infix:<+|>) +| ($BORDERLESS ?? 16 !! 0) +| ($ALLOW_HIGHDPI ?? 8192 !! 0) +| ($MOUSE_CAPTURE ?? 16384 !! 0) +| ($FULLSCREEN ?? 1 01:34
!! 0) +| ($MINIMIZED ?? 64 !! 0) +| ($HIDDEN ?? 8 !! 0) +| ($SHOWN ?? 4 !! 0) +| ($FULLSCREEN_DESKTOP ?? 4097 !! 0) +| ($FOREIGN ?? 2048 !! 0) +| ($MOUSE_FOCUS ?? 1024 !! 0) +| ($INPUT_GRABBED ?? 256 !! 0) +| ($RESIZABLE ?? 32 !! 0) +| ($MAXIMIZED ?? 128 !! 0) +| ($OPENGL ?? 2 !! 0) +| ($INPUT_FOCUS ?? 512 !! 0); }
<timotimo> i'm glad nobody has to read this code
01:34 zacts joined
timotimo since it's automatically generated and compiled 01:35
01:40 ExtraCrispy left 01:43 ExtraCrispy joined
timotimo m: class Test { }; BEGIN { my $foo = Test; augment $foo { method "lol" }; Test.lol } 01:45
camelia 5===SORRY!5===
Unexpected block in infix position (missing statement control word before the expression?)
at <tmp>:1
------> 3 }; BEGIN { my $foo = Test; augment $foo7⏏5 { method "lol" }; Test.lol }
expecting any of:
co…
timotimo m: class Test { }; BEGIN { constant foo = Test; augment foo { method "lol" }; Test.lol } 01:46
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed augment
at <tmp>:1
------> 3BEGIN { constant foo = Test; augment foo7⏏5 { method "lol" }; Test.lol }
timotimo ho-hum
01:52 sena_kun left 01:56 MasterDuke left, MasterDuke joined 01:57 MasterDuke left, MasterDuke joined 02:33 Cabanossi left 02:37 Cabanossi joined 02:45 ExtraCrispy left
Xliff timotimo: Is the autogenerator source online somewhere where I can peek? 02:49
02:50 ferreira left
timotimo gist.github.com/554b2f3d738e55164c...84ff05e917 02:55
it'd surely look better if i hadn't been stopped in my tracks by the precomp problem 03:03
03:06 melezhik joined 03:17 reach_satori joined 03:18 melezhik left 03:19 zacts left 03:26 mowcat left 03:39 kurahaupo joined 03:47 zacts joined 03:50 ferreira joined 03:56 w_richard_w left, reach_satori left 04:12 vendethiel- joined 04:21 vendethiel- left 04:26 Cabanossi left 04:30 Cabanoss- joined 04:44 reach_satori joined 05:08 w17t joined 05:45 aindilis` left, robertle left, aindilis joined 05:48 curan joined 05:53 molaf joined 06:10 kurahaupo_ joined 06:12 kurahaupo left 06:14 kurahaupo_ left, kurahaupo joined, ufobat_ joined 06:22 Sgeo_ joined 06:23 sauvin joined 06:25 jmerelo joined 06:26 Sgeo left 06:40 zacts left
jmerelo releasable6: status 06:42
releasable6 jmerelo, Next release in ≈2 days and ≈12 hours. 4 blockers. 174 out of 302 commits logged
jmerelo, Details: gist.github.com/a9f37f2cb79d7ad719...91d6081ce3
06:45 Sgeo__ joined 06:49 Sgeo_ left 07:01 dominix_ joined 07:04 dominix left
Geth doc: aa50ea2e2a | (JJ Merelo)++ | doc/Type/Any.pod6
Adds the list contextualizer @ refs #1711
07:08
synopsebot Link: doc.perl6.org/type/Any
07:21 ravenousmoose_ joined 07:23 zacts joined 07:27 Sgeo_ joined 07:32 Sgeo__ left 07:36 [particle] left 07:38 jmerelo left, zacts left 07:41 kurahaupo left, kurahaupo joined 07:42 leszekdubiel joined 07:43 rindolf joined 07:46 domidumont joined
leszekdubiel Hello! There's a program in perl5 (200 lines) github.com/leszekdubiel/lists-and-trees and I need help from somebody profficient in perl6 parsing who will to port that to perl6. This is for company so I will pay for hours spent on working on this. If somebody is interested please contact me. 08:10
08:14 discord6 left
moritz leszekdubiel: I might. What's the time frame? 08:14
08:15 discord6 joined 08:16 discord6 left 08:18 discord6 joined
leszekdubiel no time frame, because I am only experimenting with perl6 but I'm just a newbie and maybye perl6 would be worth porting programs from perl5 08:18
so this is a test, but I have to make somebody work a little bit on translation 08:19
08:24 reach_satori left 08:25 zakharyas joined 08:26 tyil left, tyilanmenyn joined 08:27 discord6 left 08:30 discord6 joined
moritz and the goal is to create a parse tree? 08:31
leszekdubiel There is a program (some_shell_tests.sh) that reads and writes data -- this is the goal. To read data from input and write formatted data to outpput. 08:34
So we have to read with perl6 with all checks (for example numbers are quite complicated i think), put data to the same data structures as in perl5 (this is easy -- just arrays and hashes of hashes). 08:35
When writing output it has to do all check (for example if numbers are in boundary of 15 digits, if names are still okay). 08:36
08:36 Sgeo__ joined
leszekdubiel So read and write is the goal, but this has to be done very strictly. This is a part of our applicatiion in company. 08:36
08:36 reach_satori joined 08:39 tyilanmenyn is now known as tyil 08:40 Sgeo_ left 08:41 reach_satori left 08:46 cpan-p6 joined, dakkar joined
moritz ok 08:52
09:03 ravenousmoose joined, ravenousmoose_ left 09:06 leszekdubiel left 09:27 llfourn_ joined, w17t left 09:28 w17t joined 09:29 llfourn left 09:46 reach_satori joined 09:48 reach_satori_ joined, reach_satori left 10:11 scimon joined 10:43 ravenousmoose left 10:45 yqt joined, ravenousmoose joined 10:51 ravenousmoose left 10:52 ravenousmoose joined
Ven`` I thought we had a page that compared shell/run/spawn, but I can't seem to find it. Does that ring a bell to someone? 10:58
timotimo is it the ipc one from the language/ folder? 10:59
11:07 xtreak joined 11:10 xtreak left, xtreak joined 11:33 sena_kun joined 11:53 RubioTerra joined 11:59 reach_satori_ left 12:00 dakkar left 12:02 xtreak left
discord6 <Vendethiel> Where at? 12:31
12:37 cpan-p6 left, zakharyas left
timotimo docs.perl6.org/language/ipc - this one? 12:38
12:41 cpan-p6 joined, reach_satori_ joined 12:42 markoong joined 13:01 AlexDaniel left 13:08 Ven`` left 13:18 kurahaupo left, kurahaupo joined
moritz ist nur eine Woche, mehr kriegen wir mit Schulferien gerade nicht unter. Trotzdem cool :D 13:30
sorry, wrong window
13:33 indistylo joined 13:35 w17t left
scimon :) 13:35
13:43 aborazmeh joined, aborazmeh left, aborazmeh joined 13:51 kurahaupo left 13:52 kurahaupo joined 13:53 lucasb joined 13:58 [particle] joined
timotimo we don't have a way to pass a struct without a pointer to a native function, right? 14:08
El_Che do we have structs? 14:09
Geth doc: 3e5a5833cb | cfa++ | doc/Type/Any.pod6
Tidy
synopsebot Link: doc.perl6.org/type/Any
jnthn timotimo: No, though there are some patches trying to do that, though they only work if using libffi, which isn't the default 14:10
timotimo urghs
SDL2_TTF requires that for passing a color :)
so i guess if you always pass black it's fine, or if you're fine with a random color every time 14:11
tobs Is it possible to call function pointers in a struct given to me by a native library? 14:12
masak timotimo: can't you pass something with the same size as the struct?
jnthn If you know the ABI you might be able to fake it with consecutive arguments... :P 14:14
Also, it looks like it can even be specific to compiler versions... stackoverflow.com/questions/168309...4/16830974 for example. 14:16
masak .oO( livin' on the edge ) 14:17
timotimo ha!
there's actually a dcArgStruct in dyncall, at least in latest hg
we've got it in our 3rdparty version, too 14:18
jnthn
.oO( livin' on a prayer feels more appropriate :P )
14:19
timotimo time to implement i guess
jnthn timotimo: Yeah; there's a PR against MoarVM that you could extend, if you're keen 14:20
And shepherd that PR through to merge etc. :)
timotimo mhm
jnthn I'd like to see it, but...so many things to do :)
timotimo i don't actually see the PR 14:21
oh it was closed a couple days ago 14:22
jnthn timotimo: github.com/MoarVM/MoarVM/pull/1042 14:23
Ah, you foudn it
*found
timotimo scovit closed it and deleted the branch in their repo, but github kept the commits around i suppose
scovit: hey you! :)
14:24 kurahaupo left, kurahaupo joined
timotimo if they want to send an updated patch soon, i might wait for that 14:26
dyncall does support structs as arguments, but it's not documented it seems like
my compile-time enum doing stuff is blowing up in ever more interesting ways 14:34
14:35 obfusk left 14:37 RR joined, aborazmeh left 14:38 obfusk joined, RR left 14:39 skids joined
scimon #join /perl-discord 14:40
Wrote that wrong.
14:40 RubioTerra left
scimon Doh 14:40
14:40 kurahaupo left 14:41 kurahaupo joined 14:46 dakkar joined 14:47 zakharyas joined 14:50 mahafyi joined 14:59 Sgeo__ left 15:00 Sgeo__ joined 15:01 kensanata joined 15:04 w17t joined 15:05 kurahaupo left 15:06 kurahaupo joined
timotimo with figlet or toilet respectively and just a short perl6 one-liner i can get from text to an image on the SDL program thingie 15:08
i should automate it so it can render quickly changing text m)
15:12 kurahaupo left 15:13 kurahaupo joined
jnthn toilet? :D 15:13
lucasb caca.zoy.org/wiki/toilet 15:14
discord6 <Rogue> I guess they wanted to pre-empt anyone calling their software crap 15:19
timotimo it has a flag that makes everything rainbow-colored; not sure if i would have called it "gay", but it's very pretty to look at
15:21 kurahaupo left, curan left, kurahaupo joined
lucasb timotimo: just like this ruby gem: github.com/busyloop/lolcat 15:23
timotimo i've seen that one befoe 15:31
15:33 indistylo left 15:45 ufobat_ left 15:48 zachk joined 15:50 zachk left, zachk joined 15:54 RubioTerra joined
RubioTerra p6: say "x".subst(/(x)/, "$0"); 15:55
camelia Use of Nil in string context

in block <unit> at <tmp> line 1
RubioTerra p6: say "x".subst(/(x)/, "$0"); say "x".subst(/(x)/, "$0");
camelia Use of Nil in string context

x
in block <unit> at <tmp> line 1
RubioTerra The docs say the way to use backreferences on subst it using a block. 15:56
p6: say "x".subst(/(x)/, {"$0"});
camelia x
RubioTerra What's the rationale behind that?
moritz it's very handy
jnthn Because arguments to methods are evaluated before the call to the method 15:57
moritz m: say '10 for 20 Euro'.subst(:g, /(\d+)/, {2 * $0})
camelia 20 for 40 Euro
RubioTerra Got it! 15:58
jnthn So "$0" interplates $0 before the match has even happened, thus the warning
RubioTerra It makes perfectly sense now, but it wasn't very clear from the documentation 15:59
masak and a macro could be used to conveniently delay the evaluation of "$0", but methods can't easily be macros
(since they're so late-bound)
RubioTerra Yes. 16:00
subst documentation says "Using a Callable as replacement is how you can refer to any of the captures created in the regex", but it gives no explanation. 16:01
16:03 RubioTerra_ joined, cpan-p6 left
RubioTerra_ Somehow I expected .subst() to behave just like s/// 16:04
16:04 cpan-p6 joined 16:06 RubioTerra left
masak you could think of the second (replacement) slot of s/// as being a thunk -- that is, there's an "invisible" block around it 16:07
this happens here and there in the language, actually. for example, on the right side of a && 16:08
(and we call those operators "short-circuiting" because of that)
RubioTerra_ Hm... makes sense 16:12
16:14 ravenousmoose left
Geth doc: 79935d4ed9 | cfa++ | 2 files
Spelling.
16:14
Xliff toilet? 16:15
Now I've seen everything. (Actually, pretty funny!)
16:16 mantovani_ is now known as mantovani
Geth doc: 661faac4ee | cfa++ | xt/words.pws
Spelling.
16:17
16:24 molaf left 16:26 domidumont left 16:35 mowcat joined, saki joined, saki left 16:37 saki joined, saki left 16:42 w17t left 16:43 gregf_ joined 16:44 w17t joined 16:45 kensanata left 16:50 RubioTerra_ is now known as RubioTerra 16:53 mowcat left, saki joined, jmerelo joined, mowcat joined 16:55 RubioTerra left 17:09 xtreak joined, saki left 17:13 robertle joined, dakkar left 17:16 kst` left 17:29 scimon left 17:33 mowcat left, mowcat joined
jmerelo squashable: status 18:12
squashable6 jmerelo, Next SQUASHathon in 14 days and ≈17 hours (2019-03-02 UTC-14⌁UTC+12). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
cpan-p6 New module released to CPAN! Perl6-Ecosystem (0.0.3) by 03JMERELO
jmerelo .tell AlexDaniel this is the guide for the next Squashathon: github.com/rakudo/rakudo/wiki/Raku...thon-Guide Should it be updated? 18:13
yoleaux jmerelo: I'll pass your message to AlexDaniel.
jmerelo .tell AlexDaniel for instance, are we still using RT?
yoleaux jmerelo: I'll pass your message to AlexDaniel.
18:18 AlexDaniel joined
AlexDaniel . 18:19
yoleaux 18:13Z <jmerelo> AlexDaniel: this is the guide for the next Squashathon: github.com/rakudo/rakudo/wiki/Raku...thon-Guide Should it be updated?
18:13Z <jmerelo> AlexDaniel: for instance, are we still using RT?
jmerelo Hey, AlexDaniel
AlexDaniel jmerelo: what about something different? Like Rosettacode squashathon?
IIRC there are many rosettacode submissions that no longer work or need some minor adjustments
jmerelo AlexDaniel: we have a "Most Wanted Modules" two months down the line 18:20
That would be really useful.
AlexDaniel except that people won't really participate? :)
jmerelo I don't know about RosettaCode
We have the same risk, people will not participate. Plus what they do will not really be so useful. 18:21
AlexDaniel: maybe good for showing off Perl6's capabilities, but that's it...
AlexDaniel well, rosettacode is pretty cool
creating a whole freaking module is not a good entry for contributors, I think
I could be wrong thuogh
jmerelo AlexDaniel: plus it's 15 days from now. 18:22
AlexDaniel: we would have to prepare a guide, decide what repos to track (or whatever, I don't know the first thing about RosettaCode)...
AlexDaniel well, we can extract perl 6 snippets and try to run them… 18:23
jmerelo There are 1047 entries...
AlexDaniel if there's any error, we automatically file an issue…
jmerelo there's also this list: rosettacode.org/wiki/Category:Perl..._attention
AlexDaniel I don't know if many code snippets from there are actually runnable as standalone script, but… maybe worth a rty 18:24
try xD
jmerelo AlexDaniel: look, I don't dismiss it offhand. But I don't see all the necessary preparations happening in 15 days.
AlexDaniel I agree, nothing from my side for sure
18:24 cfa joined
cfa jmerelo: github.com/SqrtNegInf/Rosettacode-Perl6-Smoke 18:25
jmerelo AlexDaniel: but anyway I do seem to get the idea that you don't want a Rakudo squashathon
cfa and 👋
AlexDaniel cfa: o/ that's interesting
cfa AlexDaniel: yeah, pretty neat no?
AlexDaniel jmerelo: well, I don't think we engaged a lot of contributors last time we had it 18:26
18:26 mahafyi left
jmerelo cfa: wow, that's a lot of work... 18:26
cfa as of 15 hours ago, Moar: Good/Bad [1039/10] 18:27
github.com/SqrtNegInf/Rosettacode-...a/task.txt
18:28 yqt left
jmerelo AlexDaniel: But now... we might have Google Summer of Code 18:29
AlexDaniel jmerelo: ok ok ok :)
I'm just tossing some ideas
cfa: This is the first time I see that repo. Holy shit.
cfa hunh 18:30
jmerelo AlexDaniel: it's a good idea. But we need to flesh that out. Also, it's that person work of love. He might or might not want help there.
.seen SqrtNegInf
yoleaux I saw SqrtNegInf 10 Jan 2019 13:49Z in #perl6-dev: <SqrtNegInf> TBH, though I thought the problem worth mentioning here, I replaced that particular construction.
jmerelo AlexDaniel: Anyway, we could write that down for August, which is not done yet. 18:31
And work it out from now to then.
AlexDaniel: we might bump up the "Perl 6 most wanted" to 15 days from now, but then we also have to work out how that would go. 18:32
AlexDaniel I won't have any time to work on that, so feel free to do anything that makes sense to you 18:33
jmerelo AlexDaniel: that might be a problem; there needs to be someone there to comment and review the pull requests. 18:34
AlexDaniel I'm not the only dev, I hope :)
jmerelo I'll talk about that anyway in the other channel.
AlexDaniel in fact others are probably even more qualified to help others with that
18:35 zakharyas left 18:38 zakharyas joined
jmerelo AlexDaniel: The reaction in the other channel has been underwhelming. 18:38
AlexDaniel jmerelo: maybe give it more than 100 seconds :)
18:48 xtreak left
El_Che My daughter came to me so I could explain what pi was 18:52
wow
:)
18:59 cpan-p6 left, cpan-p6 joined
SqrtNegInf Sorry to disappoint, but most of the RosettaCode tasks are in good shape... 19:00
19:01 molaf joined
SqrtNegInf That said, there are un-implemented tasks still! 19:01
19:01 dominix__ joined
SqrtNegInf The most relevant resource at the site would be: www.rosettacode.org/wiki/Reports:Ta..._in_Perl_6 19:01
19:02 lucasb left
AlexDaniel SqrtNegInf: for some reason I thought that the situation is much worse :) 19:05
19:05 dominix_ left
SqrtNegInf There was a time that was true, yes. 19:05
But the ones remaining are a jumble of hard/boring/odd/pointless (for the most part there's a reason they're not completed) 19:06
AlexDaniel SqrtNegInf++ 19:18
jmerelo SqrtNegInf++ 19:21
So
AlexDaniel: do we stick to the Rakudo squashathon? 19:22
AlexDaniel you decide
jmerelo AlexDaniel: if that's the case, I would decide to work on something I can have some control over and help with. That's not the case with the rakudo repo. 19:23
AlexDaniel sounds reasonable 19:24
jmerelo AlexDaniel: I'll wait for some feedback from the perl6-dev crowd. Can you please check with them? I don't hang out there often 19:26
19:26 ravenousmoose joined, sauvin left 19:30 MilkmanDan left 19:31 MilkmanDan joined
TreyHarris I'm going on a 9-day cruise next month and I don't have a lightweight laptop. I'm wondering if I could put Rakudo and mirror the ecosystem onto my Rasberry Pi (I carry a big battery pack at all times in a pouch a RasPi could easily fit in, so no trouble powering it) and then use my iPad to hack when I'm cut off from everything? I should try it, would be nice 19:32
El_Che You could just enjoy the cruise and take a few books for the quiet times :) 19:39
less hacky :) 19:40
cfa ha ha 19:42
19:42 zakharyas left
TreyHarris I get twitchy when I can't code a little bit every day, and the only coding you can do on an iPad by itself is Swift Playgrounds, which is cool and all, but very self-contained and constricting. 19:43
El_Che the ipad is just awfull for typing
TreyHarris I don't mind it, but I have a hardware keyboard 19:44
I use it for most terminal work these days
19:45 dominix__ is now known as dominix
TreyHarris Blink is just a lovely, lovely SSH/MOSH implementation, with enough busybox in its shell to be able to deal with pretty much any case you'd want to exchange data between a Unixlike box and the iPad's internal data storage. 19:46
There's a fork with Python in it--if I had any aptitude whatsoever with compilers I would look at getting a fork with Perl or even Rakudo. 19:47
Maybe it's something that's not as far outside my comfort zone as I think--I mean, I did internals work back in the day, but I don't think of "messing with the guts of a language" as being anything like "porting a language to a new architecture" 19:49
jmerelo, AlexDaniel: catching up... what's the "other channel" being referred to? 19:57
Argh, what's the syntax for a parameter with a name that assigns to a variable named something different when you _don't_ want the variable's name to be another callable argument alias? 20:05
20:07 jmerelo left 20:08 dct joined
El_Che TreyHarris: I didn't see the conversation 20:08
TreyHarris: but there is #perl6-dev and #rakudo 20:09
sorry, #moarvm
20:09 pecastro joined
TreyHarris El_Che: 13:38 <jmerelo> AlexDaniel: The reaction in the other channel has been underwhelming. 20:11
El_Che maybe he's talking about the one for gsoc? 20:12
AlexDaniel it was #perl6-dev 20:21
colabti.org/irclogger/irclogger_lo...-02-14#l32
TreyHarris Got it, thanks. 20:22
20:23 Possum left
TreyHarris Anybody know of a quick tool to convert an ASCII-fied representation of a key code like "^[[A" to the key (in this case, up-arrow)? 20:24
Just in a human-readable form so I can figure out what key this program is waiting for
timotimo you're looking for something with ANSI escape codes
TreyHarris Yes. (If you happen to know what key "^[[17~" refers to, that'd work too, but I feel like I should know how to do this.) 20:26
20:26 AlexDaniel left 20:27 TreyHarris left, TreyHarris joined
TreyHarris Oops, got d/c'd momentarily if someone answered 20:27
20:28 dct left
dominix hi everyone, can someone tell me how I can detect uppercase in an input ? what regex match uppercase ? 20:42
cpan-p6 New module released to CPAN! gtk-v3 (0.4.0) by 03MARTIMM 20:43
El_Che dominix: maybe a character class? 20:45
timotimo probably a unicode based one? 20:47
m: say "Hello" ~~ /<:Upper>/
camelia 「H」
timotimo m: say "ello" ~~ /<:Upper>/
camelia Nil
sena_kun m: say "Эхехе" ~~ /<:Upper>/ 20:49
camelia 「Э」
TreyHarris m: sub adjacent ( :theta(:θ($angle)) ) { return abs( π - $angle ) }; try { say "theta: {adjacent(:theta(pi/4))}"; say "θ: {adjacent(:θ(pi/2))}"; say "angle: {adjacent(:angle(pi * 3/4))}"; }; say $! 20:50
camelia theta: 2.356194490192345
θ: 1.5707963267948966
Unexpected named argument 'angle' passed
in sub adjacent at <tmp> line 1
in block at <tmp> line 1
in block <unit> at <tmp> line 1
dominix how can I detect the difference between "HELLO" and "Hello" may I match the uppercase only ? 20:52
TreyHarris m: sub adjacent ( :theta(:θ(:$angle)) ) { return abs( π - $angle ) }; try { say "theta: {adjacent(:theta(pi/4))}"; say "θ: {adjacent(:θ(pi/2))}"; say "angle: {adjacent(:angle(pi * 3/4))}"; }; say $!
camelia theta: 2.356194490192345
θ: 1.5707963267948966
angle: 0.7853981633974483
(Any)
TreyHarris m: "Hello" ~~ /HELLO/ 20:53
camelia ( no output )
TreyHarris m: say so "Hello" ~~ /HELLO/
camelia False
TreyHarris dominix: ^ matches are always case-sensitive unless you make them insensitive
m: say so "Hello" ~~ m:i/HELLO/ 20:54
camelia True
TreyHarris dominix: is that what you were looking for? 20:56
21:02 molaf left 21:09 Ven`` joined 21:13 ravenousmoose left, dogbert17 joined
cpan-p6 New module released to CPAN! META6 (0.0.22) by 03JSTOWE 21:14
21:35 cfa left
dominix the thing is I don't know the input . 21:47
El_Che you can use a switch construct with different catches with the regex timotimo wrote 21:55
Xliff m: multi sub a (@a) { say 'Array' }; multi sub a ($a) { say 'Scalar' }; multi sub a (*@a) { say 'SLURP' }; my @a = <a b c>; a(@a); a(1); a(1, 2, 3); 22:07
camelia Array
Scalar
SLURP
lucs dominix: 22:14
yoleaux 12 Feb 2019 18:12Z <tbrowder> lucs: check your email when you get a chance
lucs m: print so 'Hello' ~~ / ^ <upper>+ $ /; print so 'ABC' ~~ / ^ <upper>+ $ /;
camelia FalseTrue
tbrowder lucs: will do
lucs tbrowder: Hey, that was your message to me :) 22:15
tbrowder roger
erg, i forgot--yes, check mail, pls
lucs tbrowder: Yep, say the email; I'll try to get the Date::Names stuff done soon 22:16
*saw
TreyHarris What's the difference between `<upper>` and `<:Upper>`? Is there one? 22:17
tbrowder don't be in too big a rush--still haven't release v2 yet, and I've changed all hashes to arrays (easy enough to to, though. 22:18
lucs Um, dunno, just happened to see <upper> on the language/regexes doc page.
tbrowder: Okay, thanks, still kinda busy here.
TreyHarris: Interesting question though. Hopefully someone else knows. 22:20
TreyHarris I asked because in 5to6-nutshell, we recommend `<:Upper>` but elsewhere we use `<upper>`, and nowhere is it explained.
If semantically they're the same, it's just TMTOWTDI--`<:Upper>` calls on the Unicode class, `<upper>` is the native Perl version 22:21
But since they aren't both addressed in the same place anywhere, it isn't clear if they are semantically identical or not 22:22
dominix how do I group upper caracter + white space. $msg ~~ /<[:Lu ws]+>/ don't work 22:27
m: "YOLO AND GO ~~ /^ [<Lu><ws>]+ $/ 22:28
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in double quotes; couldn't find final '"' (corresponding starter was at line 1)
at <tmp>:1
------> 3"YOLO AND GO ~~ /^ [<Lu><ws>]+ $/7⏏5<EOL>
expecting any of:…
22:29 cpan-p6 left
dominix m: "YOLO AND GO ~~ /^ [<:Lu><ws>]+ $/ 22:29
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in double quotes; couldn't find final '"' (corresponding starter was at line 1)
at <tmp>:1
------> 3"YOLO AND GO ~~ /^ [<:Lu><ws>]+ $/7⏏5<EOL>
expecting any of…
TreyHarris m: say so "か" ~~ $_ for (/<upper>/, /<:Upper>/, /\w/)
camelia False
False
True
dominix m: "YOLO AND GO" ~~ /^ [<Lu><ws>]+ $/
camelia No such method 'Lu' for invocant of type 'Match'
in block <unit> at <tmp> line 1
22:29 cpan-p6 joined
dominix m: "YOLO AND GO" ~~ /^ [<:Lu><ws>]+ $/ 22:29
camelia ( no output )
22:29 skids left
TreyHarris I thought maybe I remembered somewhere that <:Upper> and <upper> differed in how they treated languages without case, but that isn't true 22:29
dominix m: "YOLO AND GO" ~~ /^ [<upper><ws>]+ $/ 22:30
camelia ( no output )
TreyHarris m: "YOLO AND GO" ~~ /^ <upper+ws>+ $/ 22:32
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in metachar:sym<assert>; couldn't find final '>' (corresponding starter was at line 1)
at <tmp>:1
------> 3"YOLO AND GO" ~~ /^ <upper7⏏5+ws>+ $/
TreyHarris m: "YOLO AND GO" ~~ /^ (<:Upper+ws>)+ $/ 22:34
camelia MoarVM panic: Memory allocation failed; could not allocate 20418440 bytes
guifa Has anyone made any modules for CLDR data other than the one I see for formatting lists?
TreyHarris m: "YOLO AND GO" ~~ /^ (<upper>|<ws>)+ $/ 22:35
camelia MoarVM panic: Memory allocation failed; could not allocate 20390568 bytes 22:36
TreyHarris Hmm... I don't understand why the alternation doesn't work
lucs Think I got it:
m: print so 'H AB C' ~~ / ^ [<:Lu+:ws>]+ $ /;
camelia True
lucs m: print so 'H AB x C' ~~ / ^ [<:Lu+:ws>]+ $ /; 22:37
camelia False
lucs m: print so 'H AB C' ~~ / ^ <:Lu+:ws>+ $ / 22:38
camelia True
dominix for me ~$/ do not containt what expected 22:39
sorry my bad 22:40
this one is ok $msg ~~ /^ <:Lu+:ws>+ $/
TreyHarris m: say so "YOLO AND GO" ~~ /^ <:Lu+:ws>+ $/; say $/
camelia True
「YOLO AND GO」
dominix thanks guys, I was melting my brain 22:41
lucs Good practice for us too :)
TreyHarris I don't know why those two I tried (not because they should have worked in your case--they shouldn't have) caused a MoarVM panic 22:42
22:52 rindolf left 23:16 lichtkind joined 23:19 Ven`` left
dominix what class of caraters are caracters like "%^*@#$" if I need to match them 23:47
timotimo unicodable6: %^*@#$ 23:48
unicodable6 timotimo, U+0025 PERCENT SIGN [Po] (%)
timotimo, U+005E CIRCUMFLEX ACCENT [Sk] (^)
timotimo, 6 characters in total (%^*@#$): gist.github.com/1266b3a75c9501f6d0...b92759bfae
timotimo unicodable6: help
unicodable6 timotimo, Just type any Unicode character or part of a character name. Alternatively, you can also provide a code snippet. # See wiki for more examples: github.com/perl6/whateverable/wiki/Unicodable
timotimo unidump: %^*@#$
unicodable6 timotimo, gist.github.com/c6835d00e677712c84...343fccb842
timotimo the most common distinguisher is the general category, which is Po for some, Sk for one, and Sc for another 23:49
Sc is probably Symbol: Currency 23:50
* and # have the Emoji property? huh.
23:55 dct joined
AlexDaniel` I love that bot xD 23:58
timotimo: yeah, I guess they're allowed to be rendered as emoji, or something like that 23:59
a lot of things have that property