[00:00] *** dogbert17 joined [00:02] *** rindolf left [00:02] *** dogbert11 left [00:48] *** maggotbrain left [00:49] *** maggotbrain joined [00:50] *** pecastro left [01:32] *** Doc_Holliwood left [01:37] *** guifa2 left [01:51] *** dogbert17 left [01:51] *** dogbert17 joined [01:56] *** mowcat left [02:09] *** gnufr33dom joined [02:16] .ask lizmat I ran across a code comment you left that reads ` # 'hlfix`. Do you happen to know what that means/does it indicate that the line is in need of "fixing" in some way? (It was a few years ago, so no worries if you don't remember) [02:16] codesections, I'll pass your message to lizmat [02:26] *** lucasb left [02:54] *** Garbanzo joined [02:55] *** kvw_5 joined [02:57] *** guifa2 joined [02:59] *** kvw_5_ left [03:10] *** vike left [03:19] *** vike joined [03:28] *** guifa2 left [03:37] i feel like i've asked this before, but i'm having a moment with Iterable/Iterator. if i have `class Something does Iterable` with a method `iterator` that returns something that `does Iterator`, given `my $something-instance = Something.new`, `.say for $something-instance` will emit 'Something.new' rather than calling `$something-instance.iterator`. [03:37] looking at the docs it appears I am doing this as intended [03:37] though it may be worth noting that this class has a different REPR (CStruct) [03:38] actually CPointer [03:57] *** guifa2 joined [04:11] *** rindolf joined [04:27] *** Doc_Holliwood joined [04:30] nope, still happening after it's been modified to be normal REPR [04:46] summerisle: try declaring it as @something-instance [04:46] summerisle: alternately, use $something-instance.map(&say) [04:48] well, that definitely invoked .iterator, though I would like to be able to hand off to `for`. I had also tried @$something to no end [04:48] (e.g. for @$something) [04:48] @$x [04:49] hmm [04:49] summerisle: not @$, just @ [04:49] in the decl [04:50] nope, still treats it like a single-element list and complains if i try to bind instead of assign [04:54] http://ix.io/2PAo/perl6 this prints out 1 followed by 2 for me [05:03] *** aborazmeh joined [05:07] i realised that i was still treating it as a scalar in a helper method (from-file) which changed semantics of the `my @something = Something.from-file: $file`. With that having been said, there are some semantics with the array container i'll have to work around but this gets the job done more or less. [05:31] *** gnufr33dom left [05:50] *** aborazmeh left [06:04] *** sampersand joined [06:05] Oh boy im now getting the ssl cert too logn too fro the docs [06:13] oh this is cool [06:13] say format-unit 45678.324, :unit; [06:13] Result: 45,678.324 R☉⋅YL³/lb⋅mm² [06:14] (I have no idea why anyone would want to use that unit, but hey, it can be formatted!) [06:16] *** vrurg left [06:17] *** vrurg joined [06:19] *** cog joined [06:19] *** cog__ left [06:20] lol [06:22] So right now i have a list of functions defined as `my %FUNCS = ('R" => { (^0xffff_ffff).pick }, '+' => { $^a.run + $^b.run }, ...);` I thought it might be interesting to abstract this out, and instead have a `register` function that lets me add functions myself. However, `register 'R', { ... }` isn't ideal, as it looks kinda ugly. any suggestions? [06:23] Looks okay to me. But maybe you could [06:23] register R => { … } [06:23] *** orinthe left [06:23] howd i do that [06:23] ie what would the signature look like [06:23] foo => bar is just a Pair [06:23] *** orinthe joined [06:24] *** aborazmeh joined [06:25] sorry, still dont follow. in other languages, i would just take the equivalent of `*%x`, and then just raise an exception if not a single argument was given [06:27] https://tio.run/##TY/LDoIwEEX3/Yq7EKME3InGBhIfP4J20MZHzVA1hPTbqxYN7GbOPZnHnfiSeX9tEDEddW25kULUjz26lniCOLImLZXC60RMqA3iKVoBVIbxy2bnJ9ICI63oZnWliROMD0ZRENFPbweKwyrvLPmRnHBC/LdijbxAO3eyR5uAsiHaBrRwCXahWrrv9eXgG@/f [06:27] take a look at that [06:28] (btw, why `so *` not `?*` ?) [06:28] personal preference lol [06:29] hm that seems decent [06:29] ah [06:29] so * and ?* are equivalent, but so has a looser precedence [06:30] kinda like `not`/`and` vs `!` and `&&`? [06:30] exactly the same idea [06:30] nice [06:30] is there oen for string and integer conversions? [06:31] nope. Just + and ~ as prefix [06:31] But……… [06:31] You could make one :-) [06:31] lol yeah! [06:31] well, .Numeric and and .Str [06:32] also, if a statement ends with `}`, is `;` not required? [06:32] eg `register A => { ... }` [06:32] if it ends with }\n [06:32] should i add the `;` just to be safe? or should i not do that [06:33] Totally up to you. [06:33] aight [06:33] I haven't seen anybody who puts a ; after the closing curly of an `if` or `for` block [06:33] If all of your registers are one liners, I probably would because it feels like actual statements, rather than control blocks [06:34] most of them are one lines, but not all [06:39] most of them are one lines, but not all [06:41] Is there an "identity" function? I couldn't find it anywhere on the docs [06:41] identity as in? [06:41] `sub f(\x) { x }` [06:44] I don't think. What would it be used for? [06:44] fp [06:45] ^ [06:45] Eg ruby has `.itself` [06:47] *** aborazmeh left [06:48] *** aborazmeh joined [06:50] Gotta say, i like `grammar` [06:50] so the example I saw on ruby to use that was [06:50] [1,2,3,4,5,1,2,2,3].group_by(&:self) [06:50] In Raku, that'd be [06:51] m: say (1,2,3,4,5,1,2,2,3).categorize( * ) [06:51] rakudo-moar 3235f3e42: OUTPUT: «Doesn't make sense to categorize with itself␤ in block at line 1␤␤» [06:51] ^_^ [06:51] Most functions will let you use a Whatever to replace for the invocant in arguments [06:51] in this case though, Raku's being a bit too smart ;-) [06:51] it's more like one of the functions im registering is simply an identity function: `register 'B' => { $_ }` [06:52] m: say (1,2,3,4,5,1,2,2,3).categorize( {$_} ) [06:52] rakudo-moar 3235f3e42: OUTPUT: «{1 => [1 1], 2 => [2 2 2], 3 => [3 3], 4 => [4], 5 => [5]}␤» [06:52] is `$_` considered a perlism, and `$^a` should be preferred? [06:53] *** cog_ joined [06:53] $_ is a topicalizer. It's quite useful to be able to do .foo without needing to put an explicit invocant [06:53] in your case, I'd probably use { $^self }  [06:54] or { $^identity } [06:54] Just for code clarity [06:54] fair [06:55] oh well whaddaya know [06:55] https://docs.raku.org/type/Mu#method_self [06:55] m: say (1,2,3,4,5,1,2,2,3).categorize( *.self ) [06:55] rakudo-moar 3235f3e42: OUTPUT: «{1 => [1 1], 2 => [2 2 2], 3 => [3 3], 4 => [4], 5 => [5]}␤» [06:55] TIL [06:55] so i could do `{ .self }` ? [06:56] *** ufobat_ joined [06:56] Correct [06:56] nice [06:56] what about for `!$_`, is there a shortcut for that? [06:56] `.!` doesn't work [06:56] *** cog left [06:56] But why use braces? You can also do [06:57] register A => *.self; [06:57] oh right. when i was doing the list version of it, things got weird with `=>` [06:57] *.not or { .not } [06:57] eg `A => *.Str` didnt work but `A, *.Str` did. no idea [06:58] so let's say i have `register 'E', { Knight::run .Str };` . Is there a way to make this use whatevercode? [06:59] i tried `==>`, but i got some weird errors with `.push` not being defined or something [07:00] .Str calls the Str method on $_ immediately [07:00] *** parabolize left [07:00] *.Str returns a callable that will call the Str method on its argument [07:01] yeah, i realized that [07:01] I then thought it might be cool to do function composition, but at that point am i just doing too much and should just do what im doing now? [07:01] the reason i didnt use whatevercode is because it'd only be applicable in like two places [07:03] so use it in those two placesß [07:03] s/ß/?/ [07:03] Another question. Should i be using `:D` for my type definitions? eg `multi method eql(::?CLASS $rhs, --> Bool) { $.run.cmp: $rhs }` should i do `::?CLASS:D` and `--> Bool:D` ? [07:05] *** wamba joined [07:05] Meh. I don't use it most of the time unless it's critical (or I need to have a multi that distinguishes the two) [07:05] wdym critical? [07:06] Where I know a function should never, ever be called with the value being undefined. For class methods, that can happen more often than you might think, because if you have a typed array, an out of bounds access returns a type object [07:07] ah [07:07] yeah, raku's out of boundsness is a little weird for me, eg `.substr` dies whereas arary indexing does not [07:08] *** aborazmeh left [07:09] Weird. So for some reason `$rhs.Int` is working, whereas `+$rhs` is telling me my signatures dont match. is the `+` trick just for builtin types [07:10] + calls .Numeric [07:10] which may or may not be an Int [07:10] moritz: you're a native German-speaker, ja? [07:10] ah ok that makes sense [07:13] guifa2: yes [07:13] *** ufobat_ left [07:14] moritz: okay. lesse see how unit formatting works in German. (it and French are the only ones to have fancy gender/declension information included so far by complex units) [07:14] ^_^ [07:15] ooof [07:15] definitely see abug [07:15] 45.678,232 Sonnenradius⋅KubikYottaLiter pro Pfund⋅QuadratMilliMeter [07:16] shouldn't that ben "Sonnenradien" (plural)? :D [07:16] So im getting this: `Type check failed in assignment to &!func; expected Callable[Callable] but got Block (-> $a, $b { #`(Block...)`. I thought blocks _were_ callable? [07:16] *be [07:18] That's odd. It should just be "Expected Callable". What's it paramterized/mixed in with? [07:18] moritz: perhaps… in theory it should be handling that. Lemme pick through the German rules they have [07:18] `has Callable &!func is built;` then just my register function [07:19] this: [07:20] moritz: per the Unicode rules, it says that the Sonnenradius should be singular, and Kubikyottaliter should be plural [07:21] ah, it seems in German there's no number distinction for Liter in the nominative [07:21] well, I can only offer you my intuition as a German speaker (who also happened to have a Physics master), but I haven't checked the rules [07:24] Nice :-) The units with complex compounding is in a very early stage in CLDR [07:24] *** gnufr33dom joined [07:24] They only just released the data in December so Raku will be very ahead of the curve. It just might be that the data has some issues [07:26] Unfortunately, they don't give much advice on how to handle capitalization, etc (they just say "lowercase if no space, but I know Irish and some Bantu languages happily put capital letters in the middle of words so …) [07:50] *** ufobat joined [07:50] *** squashable6 left [07:51] *** squashable6 joined [07:52] *** Garbanzo left [08:23] *** abraxxa left [08:24] *** abraxxa joined [08:26] *** mightypork_ joined [08:27] *** guifa2 left [08:27] *** Sgeo left [08:29] *** abraxxa left [08:29] *** Doc_Holliwould joined [08:30] *** abraxxa joined [08:30] *** mightypork left [08:32] *** Doc_Holliwood left [08:33] *** krkini joined [08:34] *** kini left [08:44] *** gnufr33dom left [08:46] *** krkini left [08:48] *** dakkar joined [08:52] *** kini joined [08:54] *** aluaces joined [08:57] *** wamba left [08:58] *** pecastro joined [08:59] *** jmerelo joined [09:14] *** sampersand left [09:33] releasable6: status [09:33] jmerelo, Next release in ≈4 days and ≈9 hours. 2 blockers. 22 out of 129 commits logged [09:33] 2021-02-15T18:45:05Z #raku jmerelo ty [09:33] jmerelo, Details: https://gist.github.com/858af08ab0e77a0a9a272f65f9a49355 [09:33] *** Discipulus joined [09:44] *** Scimon joined [09:57] *** Discipulus_ joined [10:00] *** Discipulus_ left [10:00] *** Discipulus left [10:14] *** aluaces left [10:21] *** Kaiepi left [10:24] *** Kaiepi joined [10:40] * lizmat clickbaits https://rakudoweekly.blog/2021/02/15/2021-07-easy-hard/ [10:40] hey lizmat, you have a message: https://gist.github.com/040e6d88b9d4ac621ab7629a4d6da8a3 [10:41] .tell codesections 'hlfix indicates an extra ' to fix syntax highlighting in some editors [10:41] lizmat, I'll pass your message to codesections [10:41] .tell it may be superfluous by now [10:41] lizmat, I haven't seen it around, did you mean hi? [10:41] .tell codesections it may be superfluous by now [10:41] lizmat, I'll pass your message to codesections [10:44] *** aluaces joined [10:59] *** ab5tract joined [11:16] *** Discipulus joined [11:25] *** Black_Ribbon left [11:27] *** rindolf left [11:57] *** kini left [11:59] *** kini joined [12:17] *** aluaces left [12:19] *** aluaces joined [12:36] *** Discipulus left [12:44] *** rindolf joined [12:48] hi, folks. i want to add a wiki to one of my websites, and i want to make any edit access restricted to approved users. i want it to use raku or perl. any suggestions? [12:53] tbrowder: ikiwiki is the first thing that comes to mind [12:53] https://ikiwiki.info/ [12:58] *** Discipulus joined [13:20] eseyman: thanks! [13:34] *** jmerelo left [13:39] thanks. I've definitely still run into cases where # 'hlfix or similar would have helped [13:39] 2021-02-16T10:41:12Z #raku codesections 'hlfix indicates an extra ' to fix syntax highlighting in some editors [13:39] 2021-02-16T10:41:32Z #raku codesections it may be superfluous by now [13:59] *** Summertime joined [14:02] *** ingy joined [14:13] *** Ulti joined [14:14] *** yguillemot joined [14:17] Hi all! I write a module for binding to Qt GUI and I wonder how to name it. [14:17] tbrowder: if not too late, look at foswiki. [14:18] I hessitate between Qt::QtWidgets, RaQt::QtWidgets and Qt::RaQt::QtWidgets [14:18] I'd go with Qt::QtWidgets myself. [14:18] Is it the rifht place to ask ? [14:18] Don't see why not. [14:19] why not just Qt::Widgets? [14:19] if you're binding to Qt GUI, why not Qt::GUI? :) [14:19] tadzik: too easy :-) [14:19] one day Qt is going to release Qt Widgets and the problem will be even funnier :P [14:20] That too. [14:22] or you take extra care to build a cute API, and call it Qt::Cute :D [14:22] Qt Widgets is the Qt name so Qt::Widgets seems the better but I read on CPAN hight level names should not be used [14:23] yguillemot: that is not so important for Raku [14:23] or figure out some backronym for PIE and call it Qt::Pie [14:23] as you can specify of which author you would like to use a module [14:23] Qt::Cute was the reason of RaQt (like PyQt) [14:24] Cutie cute? [14:24] yguillemot: if it follows the PyQt API, then RaQt would be a good name as well [14:24] imho [14:26] lismat: not sure it follows PyQt API. It follows Qt API and I presume PyQt is doing the same. [14:27] well, if you don't know for sure, I guess RaQt would not be a good name then :-) [14:28] lismat: So if there is no problem I'll choose Qt::QtWidgets [14:29] Thanks everybody [14:32] Thanks for writing it :) [14:34] yguillemot: so why the double Qt? :) [14:38] tadzik: Qt has several modules. QtWidgets is related to #include in Qt C++. Later Qt::Widget may be used for composite widgets written in Raku [14:39] yguillemot: so I may publish a Qt::Widget::Calendar myself? That doesn't conflict with Qt::Widgets though, or even with Qt::Widget afaik :) [14:40] You could also use: Native::QtWidgets [14:40] tadzik: exactly [14:40] the point of :: is namespacing. If you want things to be similar to C++ without taking advantage of namespacing you may as well publish a module called "QtWidgets" [14:40] GUI::Qt would also be a decent option [14:41] naming things is often surprisingly difficult [14:44] ab5tract: "two hard things", right? In theory, I like the GUI::Qt option, but none of the raku gtk libraries use GUI::*, so that seems confusing [14:44] codesections, indeed. if names are hard, namespacing is far worse [14:45] *** ab5tract left [14:46] GUI::Qt would get awkward the moment you start binding the other, non-GUI-related Qt libraries [14:53] m: dd my $f = True but False; [14:53] rakudo-moar 3235f3e42: OUTPUT: «Bool+{} $f = Bool::False␤» [14:54] that ^^^ is the same as False, right? (that is, the constraint isn't adding anything extra?) [14:54] camelia: welcome back! You were gone yesterday :D [14:55] *** Sgeo joined [14:56] *** ufobat left [14:56] m: my $f = True but False; say so $f  # looks like it [14:56] rakudo-moar 3235f3e42: OUTPUT: «False␤» [14:58] yeah, I knew to expect that much equivalence. Just wanted to make sure there wasn't something more subtle I was overlooking [15:10] vrurg: thanks, i will [15:10] *** gnufr33dom joined [15:15] *** xinming_ left [15:15] *** xinming_ joined [15:26] *** ufobat joined [15:28] *** yguillemot left [15:33] *** leont joined [15:36] lizmat: it seems FOSDEM published your presentation https://mirror.as35701.net/video.fosdem.org/2021/D.perl/raku_sets_without_borders.mp4 [15:46] leont++ # that is an URL I can tweet :-) [15:49] hmmm...... that URL doesn't have any video? [15:49] whereas the one I approved did? [15:49] *sigh* [15:51] *** dotdotdot joined [15:51] There's also a webm version, they both work for me [15:53] Oh, mine is up too http://bofh.nikhef.nl/events/FOSDEM/2021/D.perl/programming_lang_for_free_software.webm [15:56] er, maybe https://video.fosdem.org/2021/D.perl/programming_lang_for_free_software.webm is the more official link? [15:56] *** jmerelo joined [15:58] lizmat: there is no you in the video, but the presentation is there. [16:00] I like the bit in Lizmat's talk about "Use Objects" I think that's a big thing to get into Perl devs heads. [16:00] *** gnufr33dom left [16:05] the webm version only allows me to download the video, not play it [16:09] lizmat: try https://video.fosdem.org/2021/D.perl/raku_sets_without_borders.mp4 (or the same URL with .webm); both of those work for me [16:11] I think FOSDEM may be doing something funny with load-balancing and redirects, but that scheme seems to redirect to wherever they want me to be [16:15] as I said, on Safari, I only get audio with the .mp4 link [16:15] and the .webm link only allows me to download it [16:15] It's been served as text/html [16:16] No, wait, it's redirected to video/mp4 [16:17] oh, ok. I thought the mirror.as35401.net link might have been part of the problem; I guess not. [16:17] the download *does* have the video [16:17] Header contains this link http://bofh.nikhef.nl/events/FOSDEM/2021/D.perl/raku_sets_without_borders.mp4 [16:17] ah, but it opens it up in chromium [16:18] *** guifa2 joined [16:18] ok, I guess as Mac user, I'm persona non-grata at FOSDEM :-( [16:19] *** parabolize joined [16:20] lizmat: Big Sur Safari opens the video. [16:21] I just clicked the link on https://video.fosdem.org/2021/D.perl/ [16:22] Webm is offered for download. I guess it's Safari which doesn't support it natively. [16:22] lizmat: that seems a *little* harsh -- yeah, it seems like they didn't do enough testing against Safari. But many Mac users don't use Safari, and I imagine the lack of safari support (in some versions?) was an oversight, not an intentional choice [16:24] (Also, I'm watching your talk now – I caught the end of it live, but missed the first bit. Great talk, just as I'd expect!) [16:24] vrurg: foswiki is just the ticket! i remember looking at it years ago and pretty much decided to use it after i knew enough to be not too dangerous to my hosts ;-D [16:39] That reminds me I need to OK my video — I had a lot of silence in the Q&A and wasn't sure if I should keep it all or just clip it out [16:42] vrurg: ha. i wouldn't call not wanting to officially endorse something an "attitude" [16:43] guifa2: IIRC, there's a small edition interface, although it only allows trimming at both ends. [16:44] jmerelo: yeah, that's why I've been slow on deciding what to do :-) BAsically, I'd either need to killl the Q&A entirely or leave in lots of dead time. [16:45] jmerelo: you have access to logs on modules.raku.org? [16:46] ah nvm, seems to be working fine now [16:47] dead time is easy to skip through [16:47] Hey, Safari is my favorite browser :( [16:51] * guifa2 went ahead and upped the whole thing so his video should be available soon [16:53] yeah, not supporting (pre-Big Sur versions of?) Safari was definitely an error/testing failure on their end. But they've had to do so much with so little that I'm willing to cut them a bit of slack [16:54] tonyo: I'm afraid not [16:54] tonyo: you probably want to talk to Roman Baumer, rba [16:56] *** mowcat joined [16:57] codesections: sorry if I seemed a bit harsh [16:58] I guess I have a hard time forgetting they managed to lose Larry's talk at FOSDEM 2015 where he announced the release of what is now Raku [16:58] lizmat: no worries at all :) I understand the frustration [16:58] oh wow, I didn't know that backstory [16:59] fun fact:: they paid for Larry to be there [17:09] *** aborazmeh joined [17:12] *** [Sno] left [17:15] *** sno joined [17:16] *** domidumont joined [17:27] *** Discipulus left [17:27] *** dakkar left [17:28] *** dakkar joined [17:38] *** dakkar left [17:45] *** natrys joined [17:47] *** Scimon left [17:51] *** xinming_ left [17:52] *** xinming_ joined [17:57] *** m_athias2 left [17:57] *** m_athias joined [18:03] *** patrickb joined [18:06] *** cetjs2 joined [18:06] hello [18:07] I'm student interesred this gsoc project https://github.com/perl-foundation-outreach/gsoc-2021-ideas/blob/main/raku/gRPC.md [18:08] how I do participate in this? [18:09] jmerelo, cast [18:10] cetjs2: if jmerelo doesn't respond to you on here, definitely shoot him an e-mail — he's very good at responding to e-mails [18:12] *** aborazmeh left [18:13] guifa2,ok but I think walt a bit [18:15] *** aindilis left [18:18] cetjs2: if you do twitter, you can also contact JJ at @jjmerelo [18:19] *** dataangel left [18:20] lizmat, me not in twitter, [18:24] *** Maylay left [18:24] *** Maylay joined [18:25] * guifa2 is finally getting to watch lizmat's presentation [18:25] cetjs2: this twitter thread may be relevant then: https://twitter.com/jjmerelo/status/1355948890500042762 [18:25] Hey [18:26] cetjs2: thanks for your interest. We're right now at the phase in which we're still asking Google for money. We don't know yet if we will be funded. [18:27] cetjs2: so it's probably wise to wait a bit. Anyway, if you send me an email (jjmerelo at gmail) we'll ping you when it's funded [18:27] *** Maylay left [18:31] *** Maylay joined [18:32] *** neshpion joined [18:36] *** Doc_Holliwould left [18:37] jmerelo, I sent mall [18:37] *** sortiz joined [18:37] \o #raku [18:38] sortiz, hi [18:41] *** tejr left [18:41] *** tejr joined [18:59] cetjs2: I'm sure people will be willing to mentor you in here too on the project even if it doesn't go through gsoc, fwiw :> [19:01] *** Doc_Holliwould joined [19:02] *** xelxebar_ left [19:02] *** xelxebar joined [19:14] cetjs2++ for not being on twitter :) [19:15] *** aindilis joined [19:16] codesections: did you see my crazy unit format tests from last night? [19:16] no, I missed that. Is it in the backlog here? [19:17] Eh maybe. suffice it to say [19:17] format-unit 12345.6789 :unit; [19:18] outputs '12,345.6789 R☉⋅Yl³/lb⋅mm²' [19:19] ha! [19:19] reminds me of m.xkcd.com/687/ [19:19] but of course it's fancier than that :-) It can also spell out the units [19:20] format-unit 12345.6789, :unit, :language, :length [19:21] ١٢٬٣٤٥٫٦٧٨٩ نصف قطر شمسي⋅يوتالتر مكعّب لكل رطل⋅ملّيمتر مربّع [19:21] Which I'm just going to have to take it from Unicode that that's accurate ;-) [19:21] wow [19:23] *** domidumont left [19:23] English yields "12,345.6789 solar radius-cubic yottaliter per pound-square millimeter" [19:23] i thought our numerals were already arabic [19:23] *** Garbanzo joined [19:23] neshpion: There's three different sets of digits that called Arabic [19:24] and the one most commonly called that, isn't [19:25] Wikipedia has a good table here of the differences: https://en.wikipedia.org/wiki/Eastern_Arabic_numerals [19:27] If you include a country code, the formatter should handle that. [19:27] eg [19:27] format-unit 12345.6789, :unit, :language [19:27] 12.345,6789 متر [19:28] (Morocco prefers Western style digits) [19:35] m: say عبّرم رتميلّم⋅لطر لكل بعّكم رتلاتوي + 0 [19:35] rakudo-moar 3235f3e42: OUTPUT: «5===SORRY!5=== Error while compiling ␤Bogus postfix␤at :1␤------> 3say عبّرم رتميلّم7⏏5⋅لطر لكل بعّكم رتلاتوي + 0␤ expecting any of:␤ infix␤ infix stopper␤ postf…» [19:35] wow, switching from LTA to RTL in a single line is confusing... [19:36] Yup :-) [19:37] m: say 0 + ١٢٣٤٥٦٧٨٩ [19:37] rakudo-moar 3235f3e42: OUTPUT: «123456789␤» [19:37] err, I guess I should have only dleeted the thousands separator, meh. You get the idea [19:38] it's a bit tempting to start pointing to the previous line in IRC with ٨٨٨٨ [19:39] I guess I could just do ↑↑↑↑↑, but somehow that seems like less fun :D [19:40] I had a few places in my dissertation where I quoted multiline RTL text. It's still kind of weird that you start from the left on one line in English, then when the quote starts, you skip to the end of the line, read toward the start quote, then for the NEXT line start on the right, read the whole line, then the NEXT line start at the end quote, read to the start of the line, then skip to the end quote, and continue reading to the end [19:40] the line [19:41] oh. [19:41] Even worse though is when I'm writing tests [19:41] If you include text in <> brackets [19:41] I would be *very* tempted to turn those into block quotes [19:42] Most operating systems will display . But what you see as < is actually probably internally encoded as >, and vice versa, and will change based on the surrounding text [19:42] *** Froogal joined [19:42] *** Black_Ribbon joined [19:44] * codesections wonders whether Acme::Anguish could add RTL shenanigans [19:47] I'm assuming yes, but accessing a Hash in multithreaded stuff shouldn't cause any problems, right? [19:48] reading should be fine. writing is not safe [19:48] hi!  I'm using the WWW module to grab data off the web, however I'm using the Json::Fast module for JSON parsing and processing but the data I get back is a Str.  The Str is [{"some_key": "some_value"}].  The JSON processor isn't working because of the leading and trailing square brackets i think.  How can I trim these off? [19:49] i think the bigger issue is that if it is actually the case that it's giving back a string, it's not handling valid JSON [19:49] conventionally you don't see bare arrays often, but afaik they are permissible [19:49] I checked the type its a Str [19:50] well, a quick fix would be to extract everything between the opening and closing brackets using a regex [19:50] but that's not ideal [19:50] XD Ive been trying to use regex to match the first and last bracket but I'm bad at them [19:50] if you are 100% certain that the brackets will always be there, you could trim the first and last chars off the str [19:51] well, there is https://docs.raku.org/type/Str#routine_substr [19:53] sweet thanks! [19:53] *** Froogal left [19:55] *** ufobat_ joined [19:59] *** ufobat left [20:32] *** Discipulus joined [20:36] *** rindolf left [20:39] *** xinming_ left [20:39] *** xinming_ joined [20:55] *** Discipulus_ joined [20:55] *** Garbanzo left [20:57] *** Discipulus left [21:21] *** patrickb left [21:41] *** aborazmeh joined [21:47] *** Garbanzo joined [21:55] *** Froogal joined [21:56] So would the Perl docs be a good place to get info on how to use s/// or tr/// for find and replace on a string? [21:56] It says they work pretty much the same on Raku.org [21:57] *** epony left [21:57] To some extent. JUst be aware of course that Raku's regex language is different from Perl's [21:59] I see, guess I should start there. [22:05] for s/// it's pretty straight forward. S/X/Y/ shorthand-ish for $string.subst(/X/, /Y/) [22:05] s/X/Y/ is shorthand is for $string .= subst(/X/, Y) [22:06] but s/// and S/// act on the topic ($_) [22:08] Froogal: is there something missing from the raku docs on s///? https://docs.raku.org/language/regexes#Substitution [22:08] guifa2 thanks! [22:10] codesections I'm sure you know that sometimes docs just don't cut it.  You need actual input from other people with more experience or a fresher prospective than yours. [22:10] *** ufobat_ left [22:14] *** Froogal left [22:15] *** Froogal joined [22:18] yeah of course :) I just was surprised to hear you mention resorting to the docs for a different language [22:19] codesections Gotcha lol so far so good with it I think lol.  Just getting used to the differences. [22:29] And of course we're here for any other Qs [22:30] *** japhb joined [22:32] say S/R// with $catStr; doesn't seem to work/  R is a named regex obj.  $catStr is a Str, I want to replace the matched characters with nothing, essentially removing them.  Where am I going wrong? [22:33] I'm trying to use s/// and I"m following this ex:say S/o .+ d/new/ with 'old string';      # OUTPUT: «new string» [22:34] I bet its my regex since its different in Raku. [22:34] Those of you who enter characters not directly on your keyboard, composed of a base character and a combining mark, what do you expect when you've just entered such a pair and now hit backspace? (I'm in the middle of writing a pure-Raku replacement for Linenoise because I'm frustrated with all the things it does wrong, and among those is basically anything having to do with any part of Unicode more complex [22:34] than needed for latin-1 emulation.) [22:35] japhb: the norm is to delete the whole character [22:35] Generally even for languages where the composed character is made of several sub elements (like Korean) [22:36] OK, so effectively as soon as you add a combining mark, the buffer is re-normalized and acts as if the combined character was input as a single unit? [22:37] OK, I can work with that, and it fits my intuitive expectation, but I don't have much experience with non-US keyboards. [22:37] So I figured I'd ask. ;-) [22:37] correct. That's also how many libraries around text input work. When I wrote spell checking stuff, if someone used a dead key, I wouldn't get the letter until the next letter was hit [22:37] *** Discipulus_ left [22:38] Yeah, I'm discovering all sorts of "interesting" bits -- like what happens when you use ^T to swap two characters and they're not the same visual width. [22:38] *** Froogal left [22:39] Thanks, guifa2. [22:40] The crazy ones would be something like Japanese [22:41] Whereas my Spanish keyboard will hold the dead key in a temporary buffer of sorts, it's possible for an entire sentence to be held onto [22:41] guifa2: How so? You mean just multiple keystrokes to produce each character? ... Oh, yeah, that's ... huh. [22:41] as they'll type it phonetically and then it'll try to break it down into the Kanji, and then when it's the right set, they "commit" it so to speak [22:41] Why would it hold that much? Is there long-distance character agreement to worry about? [22:42] yea. Every kanji has multiple readings, and since you type phonetically normally, there are multiple resolution paths [22:42] Oh joy. Wait, how does e.g. xterm get this right? I can't imagine it has that complex input logic in it .... [22:43] It might be handled by the OS's IME [22:43] and then dropped into xterm almost C&P style. [22:43] (Though to be fair, they are pretty pedantic about compatibility with ancient hardware, so maybe they're pedantic about this too.) [22:43] Oh! That's an interesting case. [22:43] So for some languages, I may not actually get raw editing control. Hmmmm. [22:44] I think if you treat things at a glyph level you should be okay. [22:44] I wouldn't be sure about xterm. That codebase is big, and harry. I wouldn't be shocked if it handled some pretty obscure edge cases [22:44] I think I basically need to do an NFG renormalization after each insert. [22:44] I think languages like ones based on devanagari script split things into two glyphs, but then have the font do the ligaturing. I'd need to double check [22:47] Hmmm. OK, I think if I can even get basic expectations right, it will already be strictly better than Linenoise is now, and by then I might even know the right questions to ask to figure out what else is LTA in my implementation. [22:49] guifa2: Something that you said: "dead key" -- do you mean that you enter combining marks *first*, before the base character, and it buffers the combining mark waiting for something to put it on? Or am I misunderstanding? [22:54] *** natrys left [22:54] Correct. It comes from the old typewriter days. To do accents back then, you'd hit, e.g., ´ (acute), and then typewriter would slam down the metal with the acute accent on it, but it wouldn't move the printhead forward. Then when you typed a, it would type the a over top of the acute, and you'd have á. [22:54] *** natrys joined [22:54] But it also depends on language. Some languages have the accented keys prebuilt onto the keyboard (like French) [22:56] Nonetheless, in Unicode, it's stored in the opposite direction. IIRC that's why in Raku you can't get a fully live buffer, because when someone enters in "E" it's theoretically possible for there to be 1 or more combining diacritics [22:56] Hmmm, I wonder what happens when I NFG a buffer that has combining characters in it before the base characters. [22:57] it should apply them to the next character [22:57] Not sure exactly your architecture, but perhaps you could place combiners on top of a PUA code point. [22:58] guifa2: I meant, I wonder what MoarVM's Unicode handling will do with that. As you said, there seems to be an assumption of reading input in Unicode with marks after, but I haven't dived into the MoarVM code to look at it. [22:59] Huh, that's an interesting idea. [22:59] I'm fairly certain most IMEs won't ever give you the raw combining diacritic, though, so you might be looking at an edge case to an edge case [23:00] Basically (at the moment at least) I'm setting $*IN to raw mode using Term::termios, then reading bytes one at a time until I get a decodable character, and then interpreting that character as either (part of) a control sequence, or a request to insert/append the character to the result buffer. [23:01] I'm not stuck on that implementation, but I'm not sure what to replace it with (aside from our discussion above putting some constraints on it) [23:02] Actually, the reason that an IME probably won't let you get a raw combining diacritic is because unless it's the first character in a string, by definition it will always combine with the nearest (going backwards) base character [23:03] if $*IN has A, B, C, E+acute -> ABCÉ. [23:03] if you get acute again [23:04] per Unicode it should be ABCÉ́ [23:04] which may not show the second accent lol [23:04] I can see it in the IRC window, but it's a good question what a raw-mode terminal will send me in that case ... [23:06] *** xinming_ left [23:08] *** xinming_ joined [23:11] I'd just try playing around. Different OSs will probably drop stuff in there differently. [23:12] is shows up fine in my (emacs -nw) IRC client [23:12] (running inside Alacritty, which has somewhat amazing Unicode support, afaict) [23:14] *** Manifest0 left [23:15] *** Manifest0 joined [23:20] *** aluaces left [23:45] *** natrys left [23:47] *** dogbert11 joined [23:51] *** dogbert17 left [23:56] *** sortiz left [23:57] *** tusooa joined [23:57] *** sortiz joined