🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
00:06 ufobat_ left 00:11 cpan-raku left 00:12 cpan-raku joined, cpan-raku left, cpan-raku joined 00:13 leont left 00:25 thdrmz1 joined 00:26 thdrmz left, thdrmz1 is now known as thdrmz 00:42 RaycatWhoDat joined 00:55 JRaspass left, notagoodidea left 01:07 pecastro left 01:11 hungrydonkey joined 01:13 hungrydonkey left 01:24 abraxxa joined 01:51 jmchael left 02:00 Doc_Holliwood left 02:19 stoned75 joined 02:48 hungrydonkey joined
Geth doc/nextsame-and-friends: 4a0b621a34 | (Stoned Elipot)++ | doc/Type/Method.pod6
Broaden link to nextsame and friends
02:48
doc: stoned++ created pull request #3766:
Broaden link to nextsame and friends
hungrydonkey m:say '#' ~~ /^\#/ 02:49
evalable6 「#」
hungrydonkey m:say '#' ~~ /^ \#/
evalable6 (exit code 1) 04===SORRY!04===
Re…
hungrydonkey, Full output: gist.github.com/91782153fa075f9633...cb221f34d6 02:50
hungrydonkey m:say '#' ~~ /^ \# $/ 02:51
evalable6 (exit code 1) 04===SORRY!04===
Re…
hungrydonkey, Full output: gist.github.com/ca985990602c656847...c8d4622001
02:53 perryprog_ joined
hungrydonkey m:say "# " ~~ /^\#/ 02:53
evalable6 「#」
hungrydonkey m:say " # " ~~ /^ \s \#/ 02:54
evalable6 (exit code 1) 04===SORRY!04===
Re…
02:54 perryprog_ is now known as perryprog
evalable6 hungrydonkey, Full output: gist.github.com/f4431c66862c17c4cf...233e4dadd0 02:54
02:54 fvox left
hungrydonkey m:say " # " ~~ /\s \#/ 02:54
evalable6 (exit code 1) 04===SORRY!04===
Re…
hungrydonkey, Full output: gist.github.com/ec904c9a1f4d9cc9d4...25403944c2
hungrydonkey m:say "# " ~~ /\#/ 02:55
evalable6 「#」
02:55 ingy joined
hungrydonkey m:say " # " ~~ /\s\#/ 02:56
evalable6 「 #」
hungrydonkey m:say " # " ~~ /\s \#/
evalable6 (exit code 1) 04===SORRY!04===
Re…
hungrydonkey, Full output: gist.github.com/957595fc3941a0ce25...fd145deb62
02:56 fvox joined
hungrydonkey m:say " ' " ~~ /\s \' \s/ 02:56
evalable6 「 ' 」
02:57 stoned75 left
hungrydonkey m:say " ' " ~~ /\s \' / 02:57
evalable6 「 '」
02:57 markmarkmark joined 03:00 hungrydonkey left 03:25 marcusr joined 04:10 frost-lab joined 04:20 __jrjsmrtn__ joined 05:16 sortiz left 05:17 MitarashiDango[4 joined 06:04 parabolize left 06:09 brtastic joined 06:37 jmcgnh left 06:46 jmcgnh joined 07:08 kanopis joined 07:10 jmerelo joined 07:19 ufobat_ joined 07:21 ufobat_ is now known as ufobat
Geth doc: fe2ce3601c | (Stoned Elipot)++ (committed by Juan Julián Merelo Guervós) | doc/Type/Method.pod6
Broaden link to nextsame and friends
07:33
linkable6 Link: docs.raku.org/type/Method 07:34
07:37 sjm_uk joined 07:46 v_m_v joined
notandinus so i'm writing a cli util, it used a dispatch table in perl, it's called like: `util <action> <file>` 07:50
currently i've just defined a single MAIN sub with $action annd $file var and then used a given/when block on $action
i could use a multi MAIN for different actions instead of given/when but then there are some flags that i want to include in all of them (like --verbose, --quiet) how do i achieve this? 07:51
like if i use a multi MAIN then i'll have to include 'Bool $verbose' in all multis, how do i avoid that? 07:52
El_Che I don't see much the point in multiple mains if the signature is the sam 07:53
action and file are both strings
put the swich/handling in a separate function?
07:54 rindolf joined
notandinus i see, so i'll keep the current structure, i was just wondering if there was a better way to do this 07:54
also how do i accept a list from stdin?
say `<action> <file1> <file2> ...` 07:55
07:57 brtastic left
El_Che yes, using an array 07:58
or slurpy at the end
main is a regular function signature wise as far as I know
notandinus m: unit sub MAIN(Str $a, Array @t); 08:01
camelia Usage:
<tmp> <a> <t>
notandinus ^^ like this ?
El_Che not type Array 08:04
wait
08:07 stoned75 joined
MasterDuke you might be able to put the shared flags and such in the proto? 08:08
notandinus i don't know about proto, i'll check it out 08:11
i was looking at how zef is written but it's huge
MasterDuke docs.raku.org/syntax/proto 08:12
El_Che gist.github.com/nxadm/207cfa75d3d5...e7e341ea6c 08:13
MasterDuke a lot of times you just end up using the one automatically created when you declare a couple multis. but if you want to implement some shared functionality between the multis an explicitly created proto can sometimes be used 08:14
08:18 Sgeo left 08:31 domidumont joined 08:37 Doc_Holliwood joined 08:41 pecastro joined, stoned75 left 08:42 stoned75 joined 08:44 jmchael joined, abraxxa left 08:46 abraxxa joined 08:54 brtastic joined 09:18 brtastic left 09:19 Altai-man joined, brtastic joined 09:20 v_m_v left, v_m_v joined 09:24 v_m_v left 09:29 kanopis left, aborazmeh joined, aborazmeh left, aborazmeh joined 09:41 wamba joined 09:42 vike1 left, JRaspass joined 09:46 xelxebar_ joined
notandinus i see, thanks 09:47
is zef + META6.json the equivalent of Make? i was wondering how to distribute this simple script 09:48
jmerelo notandinus: it's not a task runner, it's not a building tool 09:49
notandinus: you might want to use Ake as a substitute for Make
(I meant a build-instructions tool above) 09:50
notandinus i just use make for installating binaries and manuals,
oh i see, i'll checkout Ake
jmerelo notandinus: it's a whole task manager. it's amazing, once you get to know all it's got. Anyway, closest to make is Ake, which is a proper task manager where you can specify tasks and what needs to be done to achieve them 09:51
notandinus i see, what is the ideal way of distributing Raku programs to others?
Geth doc: 3256bb001d | (JJ Merelo)++ | doc/Language/syntax.pod6
Separate angular parens to avoid them being gobbled.

Closes #3763
09:52
linkable6 Link: docs.raku.org/language/syntax
DOC#3763 [closed]: github.com/Raku/doc/issues/3763 [bug][docs] <<<>>> on Syntax page isn't rendered
jmerelo notandinus: one thing is distributing, other thing is building them. You're good to go with META6.json, though. You can then use zef to build/install locally. 09:53
notandinus i see, i'm using zef. can i make it install the manual too in desired location?
it does install all binaries and libraries correctly 09:54
jmerelo notandinus: I don't think zef has any kind of provision in that sense, if what you want is your pod6 rendered to groff (which is the manual format) and installed to the usual manual pages (/usr/man). Also depends on the format you're using for the manual 09:55
If you use pod6, and your manual pages are in lib/ just like the rest, those pages are precompiled and installed and you should be able to check them with rakudoc 09:56
Anyway, there's no single of standard way of dealing with manual pages that I know of.
notandinus hmm i haven't written it in pod6 format, it's mandoc format written manually, just need to place the tool.1 file in /usr/local/man 09:57
i see, thanks
10:01 v_m_v joined
kawaii Hi, I have a module which has a hash structure declared like; `our %documentation is export`, and my main script is `use`'ing this module, when my main script does `if %documentation{$arg}:exists { ... }` it never returns True, even when I know `$arg` is a valid key inside that hash. 10:03
Is this because my hash is contained within the module? It works when I move it into the main script but I wanted to tidy it away whilst still referencing it 10:04
10:06 asymptotically joined 10:07 v_m_v left
tyil kawaii: try `%Module::documentation`, where Module is the name of the module 10:08
10:08 v_m_v joined 10:12 v_m_v left
kawaii tyil: that works, thanks! :D 10:13
10:15 maggotbrain left 10:17 aborazmeh left, maggotbrain joined 10:19 v_m_v joined 10:24 vike joined 10:32 v_m_v left, v_m_v joined 10:36 v_m_v left 10:39 notagoodidea joined
Geth doc: 373de7c403 | (JJ Merelo)++ | doc/Language/syntax.pod6
Revisions and reflows.
11:01
doc: 4f10478825 | (JJ Merelo)++ | doc/Type/Associative.pod6
Clarifications and some examples
doc: 7a406bb060 | (JJ Merelo)++ | doc/Type/Method.pod6
Improve structure and adds clarifications.
11:01 v_m_v joined
linkable6 Link: docs.raku.org/language/syntax 11:01
linkable6 Link: docs.raku.org/type/Associative 11:02
Link: docs.raku.org/type/Method
tbrowder hi, all
i'm having a problem with zef and how it selects a module
with different authors and versions. does it select for highest version or alpha order on author or number on api? 11:04
Geth doc: 360220433b | (JJ Merelo)++ | doc/Language/syntax.pod6
Clarify where whitespace can't be removed, @Altai-man++
11:07
linkable6 Link: docs.raku.org/language/syntax 11:08
11:14 ilogger2 joined
tbrowder also, i see a need for some kind of module version cancellation list. the situation is with my new module with same name as david warring's older module. the both have some of the same dependencies which have also had version bumps to disambiguate them. unless the two (or more) older modules are retired, zef's default search appears to not work properly. 11:15
11:26 v_m_v joined 11:27 asy joined 11:31 asy is now known as asymptotically 11:33 v_m_v left, v_m_v joined 11:38 v_m_v left, yonnybg joined
tbrowder .tell ugexe ^^^ 11:39
tellable6 tbrowder, I'll pass your message to ugexe
tyil tbrowder: isn't :auth<> ment to disambiguate between different authors using the same name for a module?
kawaii Hi, when running this `map` operation on one of the arrays which only contains a single hash, I end up with a malformed `fields` array which contains a second item out of nowhere (github.com/kawaii/raku-mimi/blob/m...kumod#L32) - `fields => [{name => Install, value => docs.mybb.com} {name => (Any), value => docs.mybb.com/1.8/install/}]` instead of the expected single item array 11:45
11:45 yonnybg left
kawaii note how one item has the correct name, and the other the correct value 11:46
when testing with one of the documentation arrays containing multiple items, it works perfectly
tbrowder yes, but a basic request without versions should get the higher number i thought. but it looks like that is not the case. 11:48
tyil tbrowder: I'm not sure how zef resolves this, but I can tell you for sure that you should always use the most specific unitspec in your deps, so always include a :auth<> :p 11:49
leave nothing to chance or implementation of the particular module installer 11:50
tbrowder david has updated the older dependencies' version numbers, and my module has a higher version number than david's old module of the same name, but zef doesn't find them without specifying the version number.
tyil (I would generally also recommend pinning your deps to a specific version, fwiw)
tbrowder i have done that in my module. 11:51
given what david and i have done version-wise, the ver<0.4.5+> style specs should work. 11:53
i agree the auth shoudld 11:54
*should be used in certain cases, but this is a coordinated rename so the version only should be fine. 11:55
tyil it's generally safer to make sure only a single release can match in my experience
elcaro kawaii: single-arg rule is kicking in, your array doesn't contain a single Hash, it contains a Pair 11:56
tbrowder and that is what we have (unless of course we have overlooked something) 11:57
tyil tbrowder: show me your META6.json 11:58
11:58 sena_kun joined
tbrowder it will take a few minutes... 11:58
El_Che buy him dinner first
tyil lol 11:59
kawaii elcaro: ah I wasn't aware of this at all! Do I need to change the syntax for the single items to %() instead of {} to explicitly say they're hashes?
elcaro kawaii: i'm not sure that will help... i've constructed a minimal reproducable test, and that doesn't seem to help 12:01
so far the only thing that help is putting a commma after the pair, eg, topic => [{ key => val },] 12:02
but that is not really a good solution
trying to figure a better way
kawaii I mean that sounds cleaner than the hack I was going to do of checking the `.elems` in each array and just doing something else entirely if it's `= 1` :P 12:03
12:03 animalmother2 joined
elcaro tbh, i dunno how your constructing %documentation in the first place, i didn't look that far 12:04
if it's easy to throw a comma in there, then do it! :)
kawaii elcaro: github.com/kawaii/raku-mimi/blob/m...rakumod#L8
it's manually written, so no problem :)
elcaro i'm sure there's probably a "cleaner" way, but i'm tired and it's not coming to me atm
kawaii no problem, thanks for your help and explanation of the issue! 12:05
tbrowder see gist gist.github.com/tbrowder/b6eb14527...ff5317635a 12:06
animalmother2 question: How come I need a ':' in `.say for (^10).map: { $_ * $_ };` but not in `.say for map { $_ * $_ }, (^10);`? 12:07
elcaro animalmother2: short answer is the first example calls map as a method, the second is map as a function (with 2 args) 12:08
ie. second example is really `map({ $_ * $_ }, (^10))
but just calling as a function without parens 12:09
animalmother2 sure. and I see that `(^10).map({$_ * $_})` also works. So : is necessary when.. calling methods without parens?
elcaro methods can be called without parens, but require a colon, eg. @array.push: 'this'
animalmother2 ok. where is this documented? 12:10
Can't exactly google for ":"...
elcaro yeah, not sure... it is briefly mentioned here: docs.raku.org/language/syntax#Impl...in_blocks) 12:11
i'm sure it's elsewhere, just not sure where
you can call methods with parens too, ie: (^10).map({ $_ * $_ }) 12:12
notagoodidea animalmother2: docs.raku.org/language/syntax#Subroutine_calls
animalmother2 also found this: "Similarly, multiple arguments can be specified by placing a colon after the method and separating the argument list with a comma" docs.raku.org/language/objects#Methods
thanks guys. I'm not sure if I just know perl 5 too well or if raku has even more syntax to learn lol 12:13
elcaro animalmother2: typically i prefer parens, but i might drop them inside a map to avoid too many parens, eg. @lines.map(*.split: '-') 12:14
notagoodidea I don't know perl but raku has a lot of alternative syntax (beginner pov)
elcaro or, if my map is multi-line (or long enough to go on it's own line) i will `map: { `. this has the added benefit of not requiring a semi-colon 12:15
because closing brace acts as statement terminator
(erm, providing there's nothing after the closing brace on the same line) 12:16
notagoodidea animalmother2: like you example can skip map with `^10 [Z*] ^10` (I love the Z and R operators :D) 12:17
codesections another trick to avoiding parens (that I'm still not sure I fully understand is to use a combo of , and ; in an argument list) 12:18
s/understand/understand)/
m: <codesections> same, except that I don't have the "close the tab" step [11:09] 12:19
<[Coke]> I tend to have under a half dozen windows open longer than a day or
two. my kid regularly has 100 for weeks. I don't understand it.
<codesections> hence the need for bankruptcy
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3<codesections>7⏏5 same, except that I don't have the "clo
expecting any of:
infix
infix stopper
statement end
codesections <notagoodidea> codesections: One day I will be able to dot that one day. I
hoard tab with the group manager plugin based on context. Like
my "Job hunt" group have LinkedIn and a few applications I have
to answer too now or later, some group are contextualized by
activity, if I want to look at Chess stuff, I want to have X
websites at hand. [11:10]
<notagoodidea> I don't have find a good way to do it yet. Containers don't
help to not hoard tabs. [11:11]
<tadzik> the fact that hoarding tabs like this is a common theme makes me
think that there's an enormous room for improvement in bookmark
managers [11:12]
<codesections> agreed 12:20
<notagoodidea> agreed
<tadzik> if my home page had a section for "bookmarked last week" and another
for "bookmarked last year" I'll be likely to actually click on them,
or just remove them once I forget what I wanted them for
<codesections> and browser UI in general
<tadzik> I still wonder if we'd ever get browser tabs if window managers were
better in the IE6 days [11:13]
<tadzik> though most of the mainstream ones still aren't :P
<notagoodidea> If I good group-bookmark and reopen the all group that will
tadzik ouch
codesections reduce a lot of hoarding.
<tadzik> but instead all the browsers are trying to reimplement window
notagoodidea Ouch that paste :/
codesections managers, poorly [11:14]
<notagoodidea> s/good/could
<tadzik> notagoodidea: I'm sure there are browser extensions for that,
actually
<notagoodidea> Kind of, there is a few with different trade-off, tried a few,
I am using Simple Tab Group rigth now but meh. [11:16]
animalmother2 apparently pastes are throttled lol
codesections <tadzik> yeah, native stuff tends to work better when it's available. I'm yet
to see a Speed Dial as good as the one from old Opera [11:18]
<tadzik> or new Opera, for that matter 12:21
El_Che kick to poor bastard so he can rejoin afterwards
codesections *** chovy (~chovy@pdpc/supporter/active/chovy) has left channel #raku: #raku
elcaro kawaii: `topic => [ ${ ... } ]` also forces item context and makes a Hash (or `[{ ... }.item]`)
codesections [11:20]
<notagoodidea> Trying to make it play nice with Containers in Firefox is a
chore too.
<El_Che> I love firefox containers [11:21]
<tadzik> they're a lifesaver
<El_Che> certainly as cookie autodelete works well with them [11:22]
<notagoodidea> I tend to use more more fo thematic grouping than anything so
lots of friction on the way. [11:27]
<El_Che> notagoodidea: you can sort tabs by container [11:29]
*** kanopis (~kanopis@p548878b7.dip0.t-ipconnect.de) has quit: Ping timeout:
260 seconds [11:30]
*** melezhik (62c662c5@c-98-198-98-197.hsd1.tx.comcast.net) has joined channel
#raku [11:32]
notagoodidea animalmother2: In fact `^10 Z* ^10` works too
codesections <melezhik> .tell tony-o - please let me know if you need any help with new eco
system / sparrow testing things ... I'd glad to help ...
<tellable6> melezhik, I'll pass your message to tony-o
<melezhik> is it a bug in raku.land? Sparky should 0.0.29, but it's still
0.0.26 - modules.raku.org/dist/Sparky:cpan:MELEZHIK VS
raku.land/cpan:MELEZHIK/Sparky [11:37] 12:22
<JRaspass> Looks like the version in the META6.json wasn't updated, it shows
0.0.26 in the 29 tarball for me [11:39]
<JRaspass> we generally trust the json file, not the filename
<codesections> unrelated: there's a global Slack outage at the moment. [11:40]
*** patrickb (~quassel@55d467ab.access.ecotel.net) has joined channel #raku
<patrickb> .
<tellable6> hey patrickb, you have a message:
gist.github.com/5e56fc6d95ab0b4d0f...4cf5bd87f2
* codesections smug IRC user
<jdv79> nobody knows who runs the irc logger? [11:43]
<melezhik> codesections ++ we see at our \@job [11:44]
<jdv79> i just realized its down. it looked ok until i tried to send a msg.
[11:45]
<melezhik> JRaspass, -
github.com/melezhik/sparky/blob/ma...6.json#L38 , oh
, interesting ... [11:46]
<MasterDuke> the colabti website was (still is?) down also
*** patrickb (~quassel@55d467ab.access.ecotel.net) has quit: Ping timeout: 246
seconds
<melezhik> I use sparrowhub.io/plugin/raku-utils-mi6/0.000003 to 12:23
release new versions ... I wonder if it's mi6 issue ...
<JJAtria[m]> I've had similar issues with mi6 occasionally not updating a
version number. I've made it a point to manually check before
uploading nowadays [11:47]
*** hungrydonkey (~frost@59.71.244.250) has joined channel #raku [11:48]
notagoodidea No chan op around?
codesections <JJAtria[m]> Although I think in my case it was not the META file that was not
bumped, but the version in one of the modules
<JRaspass> i like the image in the markdown though, looks good on the site :-)
[11:49]
<melezhik> JRaspass, yeah, thanks , looks good for me to ))) [11:50]
*** brtastic (~Thunderbi@2a02:a315:413a:7580:879e:25b4:92ae:7858) has quit:
Ping timeout: 264 seconds [11:53]
<jdv79> moritz: you ran the first irc logger, right? [12:04]
*** leont (~leont@86-87-152-242.fixed.kpn.net) has quit: Quit: Leaving [12:07]
*** Kaiepi (~Kaiepi@47.54.252.148) has quit: Ping timeout: 260 seconds [12:17]
*** aluaces (~aluaces@144.178.134.249) has quit: Excess Flood
*** aluaces (~aluaces@144.178.134.249) has joined channel #raku [12:28]
*** rindolf (~rindolf@inkscape/contributor/rindolf) has quit: Quit: Shlomi
Fish ("Rindolf") has left the server. “Some people grow older and
wiser. Not I. I grow older and more foolish.” [12:35] 12:24
<tony-o> 2. [12:36]
<tellable6> 2021-01-04T16:32:46Z #raku <melezhik> tony-o - please let me know
if you need any help with new eco system / sparrow testing things
... I'd glad to help ...
rindolf wtf?
codesections *** notagoodidea (~notagoodi@ip-213-127-99-21.ip.prioritytelecom.net) has
quit: Ping timeout: 264 seconds
<tony-o> .tell melezhik start uploading with fez would help me identify some
issues with it
<tellable6> tony-o, I'll pass your message to melezhik
<melezhik> tib started a lot of issues/feature requests for Sparky -
github.com/melezhik/sparky/issues , if someone is
kawaii ?
codesections interested in participating, please let us know ))) [12:40]
tadzik poor guy is probably apologizing already, but we won't see it until the paste finishes
codesections <melezhik> or just comments would be useful ... [12:41]
*** domidumont (~dodu@91-175-103-119.subs.proxad.net) has joined channel #raku
[12:43]
<tib> hey melezhik \o
<melezhik> hey! [12:44]
<tib> @all or just come to drop a star or leave a smiley on an issue ! :)
[12:48]
<melezhik> Sparky CI is written on Raku, here is a discussion for people who 12:25
think about try it out -
github.com/melezhik/sparky/discussions/43 [12:54]
aukkras AlexDaniel`: ^ can you do something about codesections
codesections *** Kaiepi (~Kaiepi@47.54.252.148) has joined channel #raku [13:13]
*** domidumont (~dodu@91-175-103-119.subs.proxad.net) has quit: Ping timeout:
256 seconds [13:16]
12:25 jess joined
codesections *** ggoebel (~ggoebel@c-73-82-150-51.hsd1.ga.comcast.net) has joined channel 12:25
#raku [13:19]
*** abraxxa (~abraxxa@tsa-tc-flod-1.t-systems.at) has quit: Read error:
Connection reset by peer [13:28]
*** notagoodidea (~notagoodi@ip-213-127-99-21.ip.prioritytelecom.net) has
joined channel #raku [13:31]
*** wamba (~wamba@193-194.moravanet.cz) has quit: Ping timeout: 260 seconds
[13:39]
*** wamba (~wamba@193-194.moravanet.cz) has joined channel #raku [14:03]
notagoodidea tadzik: hoping that the past does cover the last 24h.
codesections *** brtastic (~Thunderbi@89-64-2-152.dynamic.chello.pl) has joined channel
#raku [14:11]
*** leont (~leont@86-87-152-242.fixed.kpn.net) has joined channel #raku
notagoodidea does not*
codesections [14:13]
*** ufobat (~martin@dynamic-095-114-131-237.95.114.pool.telefonica.de) has
quit: Ping timeout: 260 seconds [14:28] 12:26
t;Geth> ¦ doc: 5cad6f55bf | (Stoned Elipot)++ | doc/Type/Associative.pod6
Fix whitespace
aukkras ...
12:26 mori017 joined
codesections [14:29] 12:26
jess how long's this been happening
codesections <linkable6> Link: docs.raku.org/type/Associative
kawaii :)
codesections <moritz> jdv79: yes, I did [14:49]
*** SqrtNegInf (~SqrtNegIn@c-73-53-5-92.hsd1.wa.comcast.net) has joined
jess the codesections stuff i mean
codesections channel #raku [14:50]
*** Altai-man (~sena_kun@94.153.23.94) has joined channel #raku [14:57]
kawaii few minutes now jess
12:26 ChanServ sets mode: +o jess
codesections *** Doc_Holliwood (~holli@dslb-084-059-122-250.084.059.pools.vodafone-ip.de) 12:26
12:26 jess sets mode: +q codesections!*@*
codesections has joined channel #raku [15:00] 12:26
12:26 jess sets mode: -o jess
tadzik codesections: may I recommend weechat, which warns you if you're about to paste more than one line at a time? 12:26
jess++
jess codesections: toss me a message when you can and i'll pull the +q 12:27
12:27 brtastic joined 12:34 aborazmeh joined, aborazmeh left, aborazmeh joined
frost-lab Too many messages:] 12:34
:) 12:35
12:35 mori017 left
animalmother2 just curious, can you define custom junctions? like, can you write an `any2` junction? 12:35
moritz not easily at least 12:36
12:37 Deadly_Alive joined, cpan-raku joined, cpan-raku left, cpan-raku joined
animalmother2 gotcha, I'll stop thinking about it for now 12:38
12:38 codesections joined, ChanServ sets mode: +o jess, jess sets mode: -q codesections!*@*
jess codesections: all good? 12:38
codesections I believe so 12:39
12:39 jess sets mode: -o jess
jess fantastic 12:39
codesections very sorry about that
jess no bother, accidents happen
codesections I recently switched from WeeChat to Erc, and must not have it configured correctly 12:40
I have a non-nil value for `erc-accidental-paste-thresholld-seconds`, which I _thought_ was all I needed… 12:41
MasterDuke fyi, looks like colabti is back 12:49
codesections And here I was hoping it didn't capture that flood. Oh well 12:51
12:52 Deadly_Alive left 12:59 cog joined
tadzik hah 12:59
codesections: that thresholld sounds like a typo
cog In Perl, refaddr can be used to create a key in a hash. What would be the Raku equivalent ? The port of Scalar::Util says : Returns the internal memory address of the object as a plain integer. Please note that Raku implementations do not require the memory address of an object to be constant: in fact, with MoarVM as a back end, any longer living object will have its memory address changed over its lifetime. 13:00
codesections tadzik: yeah, but it's correct in my config/the variable I checked. I just tested an over-large paste in a msg to myself, and I was properly protected/warned. So truly no idea why it didn't save me (us?) here 13:02
cog Maybe it is good enough for that use. Or we may potentially have a problem similar to the ABA problem, here manifesting as not having the guarantee of the unicity of a key. 13:04
Geth doc: e9d0b234cf | (JJ Merelo)++ | doc/Language/operators.pod6
Tries to reorganize metaoperators ("compound" operators)

So that they're easier to find, if not exactly responding to #3768
13:05
linkable6 Link: docs.raku.org/language/operators
DOC#3768 [open]: github.com/Raku/doc/issues/3768 [docs] built-in compound assignment operators like "~=" are not searchable
MasterDuke cog: you can create object hashes and use the object directly as the key. if you really want some some of unique string representation. use `.WHICH` 13:07
m: my @a = [1,2]; my @b = [1,2]; say @a.WHICH; say @b.WHICH
camelia Array|72633944
Array|73518832
cog So WHICH is guaranteed not to change over time ? 13:08
Anyway, object as its own key is good enough, thx MasterDuke 13:10
MasterDuke cog: yeah. .WHERE is the memory address, which can change, but .WHICH is a unique id (though "different" value objects may have the same id) 13:12
m: my $a = 1; my $b = 1; say $a.WHICH; say $b.WHICH 13:13
camelia Int|1
Int|1
MasterDuke m: my @a = [1,2]; my @b = [1,2]; say @a.WHICH; say @b.WHICH; say @a.WHERE; say @b.WHERE; my $c; for ^100_000 { my @a = ^10; $c = @a.tail }; $*VM.request-garbage-collection; $*VM.request-garbage-collection; say $c; say @a.WHICH; say @b.WHICH; say @a.WHERE; say @b.WHERE 13:15
camelia Array|71206384
Array|71469864
139732949255424
139732949255368
9
Array|71206384
Array|71469864
71206384
71469864
13:27 aborazmeh left, notagoodidea joined 13:30 tomasmu joined 13:35 berber44 joined 13:43 MorayJ joined 13:46 animalmother2 left 13:57 berber44 left 14:03 Doc_Holliwood joined 14:06 Tirifto joined 14:24 aborazmeh joined, aborazmeh left, aborazmeh joined
kawaii what's the correct capture for `!d`, `!doc` and `!docs`? I have `/ ^ '!' d 'oc'? s? /` at the moment but I don't think this is right and it also captures `!ds` ;( 14:26
vrurg_ m: say '!doc' ~~ / ^ '!d' ['oc' 's'?]? $/; 14:31
camelia 「!doc」
tellable6 2020-12-29T00:51:49Z #raku <melezhik> vrurg finally I got your example working - rakudist.raku.org/sparky/report/RakuPlay-1/8889
vrurg_ m: say '!docs' ~~ / ^ '!d' ['oc' 's'?]? $/;
camelia 「!docs」
vrurg_ m: say '!ds' ~~ / ^ '!d' ['oc' 's'?]? $/;
camelia Nil
vrurg_ kawaii: I'd do it like this unless there is another requirement.
m: say '!d' ~~ / ^ '!d' ['oc' 's'?]? $/;
camelia 「!d」
14:33 aborazmeh left
kawaii vrurg: that seems to match !do also when I test 14:33
vrurg m: say '!do' ~~ / ^ '!d' ['oc' 's'?]? $/;
camelia Nil
vrurg No, it doesn't.
kawaii hmmm
ah see, I don't have the ending anchor 14:34
vrurg And it can't because 'oc' is an atom.
kawaii which I guess is the 'other requirement'
since I have arguments after it
vrurg m: say '!do' ~~ / ^ '!d' ['oc' 's'?]? /;
camelia 「!d」
Altreus do we need all that?
vrurg It does match without $ but it it only matches the part you need.
Altreus m: say '!do' ~~ / ^ '!d' [ ocs? ]? /;
camelia 「!d」
Altreus wait, that's not how I expect regex to work 14:35
I guess it's allowed
vrurg Altreus: in your case 'ocs' is an atom.
Altreus so the ? applies to the string, not the s?
vrurg Altreus: ? applies to atoms.
Altreus inneressin 14:36
so I could do [ oc s? ] ?
vrurg Altreus: apparently, you can.
vrurg is back to the main job... 14:37
Altreus :) 14:38
m: say '!do' ~~ / ^ '!d' [ oc s? ]? >> /; 14:41
camelia Nil
Altreus m: say '!d' ~~ / ^ '!d' [ oc s? ]? >> /;
camelia 「!d」
Altreus m: say '!docs' ~~ / ^ '!d' [ oc s? ]? >> /;
camelia 「!docs」
Altreus m: say '!doc' ~~ / ^ '!d' [ oc s? ]? >> /; 14:42
camelia 「!doc」
Altreus kawaii: it work
m: say '!doc holiday' ~~ / ^ '!d' [ oc s? ]? >> /;
camelia 「!doc」
kawaii Thanks guys :)
14:46 Sgeo joined 14:53 lucasb joined 14:56 Doc_Holliwood left 15:09 bazzaar joined
bazzaar m: if 1 {loop (my $i = 0; $i < 5; $i++) { 1 };loop (my $i = 0; $i < 5; $i++) { 2 }} 15:11
camelia Potential difficulties:
Redeclaration of symbol '$i'.
at <tmp>:1
------> 3 $i = 0; $i < 5; $i++) { 1 };loop (my $i7⏏5 = 0; $i < 5; $i++) { 2 }}
WARNINGS for <tmp>:
Useless use of constant integer 1 in sink context (line 1)…
xinming_ SmokeMachine: I think we should split the code handling with table name and table-col reference. now, I just tried with `temp Model.^table = "sql_function()"`, and found the col reference which will be something like sql_function().col1 15:13
bazzaar not sure why the Redeclaration message, don't the loops have different scopes? 15:14
xinming_ SmokeMachine: So, As initial support for future migration to sql_function() table expression, We can support something like `temp Model.^table = "sql_function()"` initially
tyil bazzaar: isn't the scope inside the { }, not the ( )
bazzaar tyil: good point. Though isn't the signature tied to the following block? 15:16
tyil that's too deep for my knowledge 15:17
I only 'member that a new scope is started in { }, not ( )
same happens in (most?) other languages
SmokeMachine xinming_: probably use that as: `temp Model.^table = "sql_function()"; .say for Model.^as("bla").^all` 15:18
bazzaar tyil: thanks for your help :-)
SmokeMachine xinming_: maybe that would work... 15:20
xinming_ SmokeMachine: doesn't 15:21
Too many positionals passed; expected 2 arguments but got 3 <--- This is the error, and I read the source, the .^as call is aliased to call .^table 15:22
where when we try to use ".^alias", We need to manually pass 3 named args, which I haven't figured out yet.
SmokeMachine sorry, no args to .^as 15:31
15:35 notagoodidea left 15:53 parabolize joined 15:57 Altai-man joined 15:59 sena_kun left 16:05 Tirifto left 16:09 notagoodidea joined 16:12 xinming joined 16:46 melezhik joined 16:47 guifa2 joined
guifa2 o/ 16:47
[Coke] \ 16:48
\o
(ow, that looks painful) 16:49
guifa2 When doing multi subs, it's possible to leave constants in positional arguments to help direct dispatching, e.g. "multi sub is-pos-neg(0) { die "0 is neither and both" )
Is there a way to do that with named ones?
16:51 MorayJ left, MorayJ joined
codesections busting out the controversial mathematical claim in example code; I like it! 16:52
melezhik vrurg on github.com/Raku/problem-solving/is...-754707417 , you can start with dev.to/melezhik/informal-introduct...rrow6-40pa and raku-advent.blog/2020/12/07/mixing...g-sparrow/ 16:53
codesections (more seriously: I'm not sure of a way, but I'll think about it a bit more; I agree it'd be handy)
melezhik let me know if this what you're looking for ... imho they are quite beginners friendly introductions to Sparrow
[Coke] m: multi sub test(:$a where $a == 3) { say 4 }; multi sub test(:$a) { say $a }; test(:a(3)); test(:a(5)) 16:54
camelia 4
5
[Coke] ^^ not as nice as a constant.
melezhik vrurg also on how to use Sparrow in testing you might read this - dev.to/melezhik/simple-blackbox-te...arrow6-g32
moon-child you can shorten to just :$a where 3 16:55
melezhik I personally don't Sparrow difficult to learn :-) , it's just versatile ... and could apply to many areas, but they are all about automation ... 16:56
don't -> don't find
codesections along the same lines as what [Coke] said, you could also make a constant Subset (something like Subset Three where * == 3) 16:59
and then have something like: multi test(Three :$a) { say 4 } 17:00
but I don't know if that's an improvement on what moon-child suggested
[Coke] m: multi sub test(3 :$a) { say 4 }; multi sub test(:$a) { say $a }; test(:a(3)); test(:a(5)) 17:02
camelia 4
5
[Coke] oh.
I didn't expect that to work. :) 17:03
codesections [Coke]++ oh, that's really nice! This language, man 17:04
guifa2: ^^^^ (in case you didn't see coke's answer ) 17:05
17:21 v_m_v joined
AlexDaniel` aukkras: sorry, I was asleep 17:22
aukkras np, it's solved ;)
codesections yeah, and I've learned a lesson :) 17:23
(or, sort of; I still don't really know why the accidental paste prevention feature in my client didn't save me) 17:24
17:25 dwarring joined
notagoodidea [Coke]: how it even work the `multi sub test(3 :$a)`? 17:25
3 is treated as a type? 17:26
17:27 v_m_v left, v_m_v joined
codesections notagoodidea: yeah. And, now that I think about it, that's the same thing that happens with positionals 17:28
notagoodidea m: sub test(3 :$a); say test.signature;
camelia 5===SORRY!5=== Error while compiling <tmp>
A unit-scoped sub definition is not allowed except on a MAIN sub;
Please use the block form. If you did not mean to declare a unit-scoped sub,
perhaps you accidentally placed a semicolon after routi…
notagoodidea m: sub test(3 :$a){4}; say test.signature;
camelia Constraint type check failed in binding to parameter '$a'; expected 3 but got Int
in sub test at <tmp> line 1
in block <unit> at <tmp> line 1
notagoodidea m: multi sub test(3 :$a){*}; say &test.signature; 17:29
camelia (;; Mu |)
17:31 tomasmu left
codesections m: multi sub test(3 :$a){*}; say &test.candidates.map(*.signature) 17:31
camelia ((Int :$a where { ... }))
notagoodidea Ah
codesections m: multi sub test(3){*}; say &test.candidates.map(*.signature)
camelia ((3))
17:32 v_m_v left
codesections hmm, I'm kind of surprised the positional signature doesn't have a where block too 17:32
notagoodidea m: multi sub test(3 $a){*}; say &test.candidates.map(*.signature) 17:34
camelia ((Int $a where { ... }))
codesections interesting. I thought sub f(3) was nothing more than syntactic sugar for sub f(3 $), but it looks like they have different signatures 17:37
m: multi sub f(3 $){*}; say &f.candidates.map(*.signature) 17:38
camelia ((3))
codesections m: multi sub f(3 $a){*}; say &f.candidates.map(*.signature)
camelia ((Int $a where { ... }))
codesections oh, I see: the parameter name is part of the signature 17:39
notagoodidea m: multi sub f("foo" $a){*}; say &f.candidates.map(*.signature);
camelia ((Str $a where { ... }))
codesections m: multi sub f(3 :$){*}; say &f.candidates.map(*.signature)
camelia ((Int :$ where { ... }))
codesections but the one literal that pattern won't work for is Bools 17:41
m: multi sub f(True){*}; say &f.candidates.map(*.signature)
camelia Potential difficulties:
Literal values in signatures are smartmatched against and smartmatch with `True` will always succeed. Use the `where` clause instead.
at <tmp>:1
------> 3multi sub f(True7⏏5){*}; say &f.candidates.map(*.s…
notagoodidea yep, but it work for Int/Str. What else? 17:42
17:43 MorayJ left
moon-child m: class Foo { has Int $.x }; multi sub f(Foo.new(x => 7)) {*} 17:45
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed parameter
at <tmp>:1
------> 3ass Foo { has Int $.x }; multi sub f(Foo7⏏5.new(x => 7)) {*}
expecting any of:
constraint
formal parameter
17:51 patrickb joined, patrickb left
notagoodidea How can I "delete" a subset? 18:01
18:03 sortiz joined 18:10 wamba joined
cog Is there a more idiomatic to write %info = %info, %inc_info; which recreates %info from scratch 18:11
18:18 notagoodidea left
dwarring %info ,= %inc_info 18:18
tellable6 2020-04-12T10:48:02Z #raku <tbrowder> dwarring +++ excellent, david!
2020-08-18T16:48:13Z #raku <melezhik> dwarring: I've added "patch" for LibXSLT - github.com/melezhik/RakuDist/commi...b8c95cb192 , now it successfully tests on RakuDist - rakudist.raku.org/sparky/report/debian/655
xinming dwarring: he wants to recraete it from scractch 18:19
18:19 cxreg joined
dwarring drinks coffee 18:21
cog Thx dwarring, indeed I want to add entries in the hash, and avoid the costs of recreating from scratch. Not that it matters in this particular example. 18:22
m: my @a = < a b >; my @b = < c d >; @a ,= @b # just curious 18:24
camelia ( no output )
cog m: my @a = < a b >; my @b = < c d >; say(@a ,= @b) # just curious
camelia (\Array_58809352 = [Array_58809352 [c d]])
xinming m: my @a = < a b >; my @b = < c d >; say(@a ,= |@b) 18:31
camelia (\Array_80184152 = [Array_80184152 c d])
xinming m: my @a = < a b >; my @b = < c d >; (@a ,= |@b).raku.say;
camelia ((my @Array_68968408) = [@Array_68968408, "c", "d"])
xinming m: my @a = <a b >; my @b = <c d >; (@a ,= |@b).raku.say;
camelia ((my @Array_65170152) = [@Array_65170152, "c", "d"])
xinming Why won't the @Array_65170152 print the content of @a? 18:32
18:32 melezhik left 18:38 sno joined
[Coke] m: my @a = <a b >; my @b = <c d >; (@a ,= |@b); dd @a[0]; # it's not just .raku or dd here. 19:01
camelia Array @a = ((my @Array_85009224) = $[@Array_85009224, "c", "d"])
[Coke] m: my @a = <a b >; my @b = <c d >; (@a ,= |@b); dd @a; # it's not just .raku or dd here.
camelia Array @a = ((my @Array_64788216) = [@Array_64788216, "c", "d"])
[Coke] m: my @a = < a b >; my @b = < c d >; (@a ,= |@b); dd @a[0][0][0][0][0] 19:06
camelia Array @a = ((my @Array_69386488) = $[@Array_69386488, "c", "d"])
[Coke] ^^ it's recursive, so it's doing the best it can.
19:10 melezhik joined
[Coke] m: my @a = < a b >; my @b = < c d >; (@a ,= |@b); dd @a[0][0][0][0][0][2] 19:11
camelia Str @a = "d"
[Coke] so if you printed the contents, it'd be infinite. 19:15
melezhik funny, I am browsing irc logs from colabti now. they all over the place right now. for example - colabti.org/irclogger/irclogger_lo...2021-01-05 19:22
you may find my really old comments "made" by others :-) 19:23
19:24 msiism joined
melezhik colabti.org/irclogger/irclogger_lo...01-05#l320 according to this codesections "started" to use Sparrow HA-HA :') I don't mind 19:24
looks like started after the last colabti outage ... 19:25
msiism Does anyone happen to know of a comparison of Raku against Tcl? I mean somehting like a little table or some such? 19:27
melezhik msiism what are you using Tcl for? 19:28
19:29 Doc_Holliwood joined
El_Che you'll have more luck with Perl comparison 19:29
s
[Coke] I don't think anyone has done that comparision, but tcl is better for embedding.
El_Che nice 19:30
msiism Currently I'm writing a find(1) wrapper. A while back I created a "run dialog" with Tcl/Tk. (That thing that you (used to) get when typing Alt+F2 in Linux desktop environments to start programs by typing a command.) I'm not working in the embedded field. 19:31
melezhik my tcl associations is command line / desktop automation utilities ... this is why I am asking ... If we compare by this domain you might be interested in Sparrow which is written on Raku
sparrowhub.io/ .... but it does not do any desktop / GUI things 19:32
El_Che there isn't something as integrated as Tcl/Tk
melezhik however I can think about having Sparrow plugins that Tcl scripts and so on ...
msiism Hm… I think I'm really just looking for a general-purpose programming language, one that does have some sort of usable bindings to a few GUI libraries, if possible. 19:33
El_Che msiism: there are gtk bindings
msiism Okay, well, there's probably a list of all current such bindings for Raku. So I can look that up.
El_Che but GUI is problematic even with more popular languaes like perl, go or java
melezhik yeah ... 19:34
moon-child java has good gui. perl and go, not so much
msiism I don't know that. What's the reason, in general?
I mean for GUI being problematic.
El_Che msiism: native look and feel is hard 19:35
java has a *terrible* UI native wise
msiism El_Che: Okay, my target platform is solely Unix. I should have mentioned that earlier. 19:36
And by Unix I mean Linux/BSD/illumos. 19:37
[Coke] wonders if a rakuTk binding would be used. 19:38
El_Che msiism: modules.raku.org/search/?q=gtk
msiism Thanks, I'll look into that. 19:39
Maybe it's best for me to put together a set of specific questions I have about Raku and then go hunting for answers in the documentation. (Or ask here if I can't find any.) 19:40
[Coke]: I've just learned there is P6TK. 19:41
[Coke] msiism: ah, nifty.
codesections Hmm, this feels very basic, but apparently I don't understand what "package scope" means. Why doesn't this work? 19:45
m: for <1 2> { our $bar = 42 }; say $bar
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$bar' is not declared
at <tmp>:1
------> 3for <1 2> { our $bar = 42 }; say 7⏏5$bar
19:58 sena_kun joined 20:00 Altai-man left 20:02 lucasb left
CIAvash docs.raku.org/syntax/our 20:02
[Coke] wonders what the default package is. 20:05
codesections: that our is still scoped to the block it's in, I think. 20:06
and it's all in the same package anyway (the default one), so the alias you get in the symbol table isn't really doing anything for you in that snippet.
codesections [Coke]: agreed. But isn't that just lexical scoping? What's it doing that `my` doesn't? 20:07
Is my/our just irrelevant to non-module scopes? 20:08
[Coke] per the docs, adding an alias to the symbol table, so you can look it up in the package. 20:09
melezhik .tell tony-o I've found one issue with fez - github.com/tony-o/raku-fez/issues/9 20:10
tellable6 melezhik, I'll pass your message to tony-o 20:11
[Coke] m: package foo { our $bar = 3; my $baz = 4; }; say $foo::bar; say $foo::baz;
camelia 3
(Any)
[Coke] even if you refer to $foo::baz in that block, you get the Any (because there's no alias)
codesections m: for <1 2> { our $bar = 42 }; say $::bar 20:12
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$bar' is not declared
at <tmp>:1
------> 3for <1 2> { our $bar = 42 }; say 7⏏5$::bar
[Coke] m: package foo { our $bar = 3; my $baz = 4; dd $bar, $baz, $foo::bar, $foo::baz}; say $foo::bar; say $foo::baz;
camelia Int $bar = 3
3
(Any)
Int $baz = 4
Int $bar = 3
Any element{'$baz'} = Any
[Coke] m: package foo { our $bar = 3; my $baz = 4; dd $bar, $baz, $foo::bar, $foo::baz}; dd $foo::bar, $foo::baz; # all with dd
camelia Int $bar = 3
Int $baz = 4
Int $bar = 3
Any element{'$baz'} = Any
Int $bar = 3
Any element{'$baz'} = Any
[Coke] m: package foo { {our $bar = 3; my $baz = 4; } dd $bar, $baz, $foo::bar, $foo::baz}; dd $foo::bar, $foo::baz; # all with dd 20:13
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3kage foo { {our $bar = 3; my $baz = 4; }7⏏5 dd $bar, $baz, $foo::bar, $foo::baz}; d
expecting any of:
codesections right. I get all that; I just expected it to apply to other scopes
[Coke] m: package foo { {our $bar = 3; my $baz = 4; }; dd $bar, $baz, $foo::bar, $foo::baz}; dd $foo::bar, $foo::baz; # all with dd
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$bar' is not declared
at <tmp>:1
------> 3foo { {our $bar = 3; my $baz = 4; }; dd 7⏏5$bar, $baz, $foo::bar, $foo::baz}; dd $f
[Coke] m: package foo { {our $bar = 3; my $baz = 4; }; dd $foo::bar, $foo::baz}; dd $foo::bar, $foo::baz; # all with dd
camelia Int $bar = 3
Any element{'$baz'} = Any
Int $bar = 3
Any element{'$baz'} = Any
codesections not just the ones declared with `package` or `module`.
msiism So, if there's more than one way to do it, would I be able to write Raku largely without using the <thing>.<method> syntax, and instead use something looking like <method>(<thing> <more stuff following a generally defined scheme>)?
codesections is that just wrong? 20:14
CIAvash m: { our $test = 1 }; say $OUR::test
camelia 1
codesections O.o
[Coke] ah. CIAvash++ from the docs, "OUR" is current scope, not empty. :) 20:15
er, current package.
codesections msiism: If I understand what you're asking, yes
[Coke] m: for <1 2> { our $bar = 42 }; say $OUR::bar; 20:16
camelia 42
[Coke] so, the variable in the block is lexical, but the our adds an alias to the package, and once you know where it is, you can find it. 20:17
msiism codesections: Okay, that sounds interesting. I mean like split($str ':'); or some such instead of $str.split(':'); 20:18
[Coke] Many core routines are also methods on common objects, but that doesn't mean everything is.
e.g. .split is, but .succ isn't. 20:20
codesections msiism: as [Coke] said, many are defined both ways, including .split. So those work automatically. For the others, you just need to mark the invocant with a : 20:21
msiism codesections: Could you give a simple example of the latter? 20:22
codesections m: say( succ('aa':))
camelia ab
msiism I see. Thanks. 20:23
codesections (that's not the best example, since it just takes one arg. But so many methods have been defined as functions as well that there aren't a ton of examples to pick from) 20:24
m: say polymod(120: 10) # slightly better 20:25
camelia (0 12)
msiism Okay, I get now what invocant means. Is an invocant not the same as an operand? 20:26
codesections similar, but not quite the same. Operands are for operators and there can be more than one. (e.g., in 1 + 2) 20:28
invocants are for methods, and there's always just one 20:29
msiism Okay, but there are also unary operators, right? Would that be sort of the same then? I mean, if you think of methods and operators as just functions? 20:30
[Coke] hurls docs.raku.org/language/objects#ind...ant_syntax 20:31
MasterDuke in raku operators are just subs
msiism [Coke]: Okay, having a look.
codesections yeah. I mean, since both are just functions, both operands and invocants are a type of argument
Geth problem-solving/solution-250: c38c72d1ff | Altai-man++ | solutions/documentation/search-categories.md
Provide a solution document for github.com/Raku/problem-solving/issues/250

  "Documentation search categories are not standartized"
Fixes github.com/Raku/problem-solving/issues/250
20:33
MasterDuke m: sub infix:<(|)>($a, $b) { say "$b )|( $a" }; 4 (|) "123";
camelia 123 )|( 4
msiism So, is it always safe to put the ':' mark after the invocant, even for things like split? Or would I have to watch out for that? 20:34
[Coke] if you use the invocant mark on split, you're calling a different routine.] 20:35
m: dd split "what the":, 't' 20:36
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3dd split "what the":7⏏5, 't'
expecting any of:
colon pair
codesections it's always "safe", but might change the order of the arguments.
[Coke] m: dd split("what the":, 't')
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3dd split("what the":7⏏5, 't')
expecting any of:
c…
codesections m: dd split("what the": 't')
camelia ("wha", " ", "he").Seq
codesections (the : replaces the ,) 20:37
[Coke] ... thank you.
msiism Okay, good to know.
MasterDuke m: class Foo { method bar($a) { say $a + 4 } }; my $b = Foo.new; bar($b: 3) # works for generic user-defined stuff too
camelia 7
codesections yep. And you can go the other way (call a sub as a method by having .& instead of just . ) 20:39
20:42 melezhik left
msiism codesections: How did split("what the": 't') change the order of arguments, though? I didn't really get what you meant by that. 20:43
codesections sorry, I'd stepped away. I just meant that they might expect arguments in different order. docs.raku.org/routine/split 20:49
msiism Okay, thanks.
codesections m: split('', "the quick brown fox" ) 20:50
camelia ( no output )
codesections m: say split(' ', "the quick brown fox" )
camelia (the quick brown fox)
codesections m: say split("the quick brown fox": " " )
camelia (the quick brown fox)
msiism I see. 20:51
This is all pretty nice. :)
20:59 hankache joined
hankache hello #raku 20:59
21:00 wamba left
sortiz \o hankache 21:06
cog o/ hankache, I hope things are better in Beyrouth 21:07
21:10 eax joined
hankache hi sortiz 21:13
hi cog. How are you? Long time no speak. Things are not that great but getting better.
cog I hope 2021 will be better for everyone 21:14
hankache hopefully 21:15
what's the technical difference between zef uninstall X and zef nuke X? 21:23
21:37 eax left 21:46 msiism left 22:13 dwarring left 22:14 sena_kun left 22:16 notagoodidea joined 22:24 hankache left 22:26 melezhik joined
melezhik I've create my very first Sparrow plugin written on golang -:) - github.com/melezhik/sparrow-plugin.../sparky-db 22:27
I find "sparrowgo" is really attractive name for anything Sparrow/Go related ... ha-ha . I like how the word sounds ... 22:28
El_Che melezhik: you forgot to "go fmt" :) 22:29
melezhik the thing is you can create all-dependecies-included go utulities and run it using Sparrow/raku ..
El_Che bear with me :-) , this is probably my very first go program ... though written in Sparrow way . ha-ha!
once I make it a plugin you can run it as `s6 --plg-run sparky-db` or even now on my mac `cd sparky-db && s6 --task-run .` 22:30
El_Che melezhik: you should take some code out of main and put it in an other function
why go? 22:31
melezhik El_Che why?
El_Che go users are very anal on short func length
and separarion of duties
melezhik El_Che just for the sake it's self-contained all dependencies in binary, you don't need any sqlite bindings
El_Che if selfcontained is the objective maybe vendoring is an option 22:32
melezhik "go users are very anal on short func length" - I don't that care, this is not for go users ...
22:32 ajdplaysalto joined
El_Che don't you see how anal I am with my comments :) 22:32
melezhik this is for Sparrow users, that will either run it as `s6` or as Raku function using Sparrow6::DSL
El_Che ))) I am a head to kill as well ha-ha , 22:33
btw , what do you mean by "vendoring is an option"? 22:34
El_Che go mod vendor
22:34 ajdplaysalto left
El_Che you get the libs in a vendor directory in the source repo 22:34
so you can build without Internet
melezhik more or less the same idea - use go so not bother with dependencies on target host 22:35
but still in high-level run is as Raku function or s6 cli thing
El_Che melezhik: golang.org/ref/mod#vendoring 22:36
melezhik in that case it will work without even need of any DB::SQLite
El_Che++
El_Che with recent go versions vendoring is less important because google provides now a write-once module proxy 22:37
so you get the reprodubility without the need of vendoring
melezhik ok, I see. I will test it and see how it goes, thanks for info
El_Che but, like I said, if you need to build without internet, vendoring is a good way to include all the dependencies 22:38
I don't know how the binary will be created or retrieved
will it be compiles on a client machine? will it be downloaded from github? will it be packaged? 22:39
depending on the answer you'll get a different answer
but big plus for using modules
even for a small program
melezhik sorry, I thought that the whole idea behind distribution of go programs -- is you build them once and you don't build anything on target machine 22:43
all the dependencies are already included statically in binary file
El_Che yes, of course 22:44
(as long you don't have C dependencies)
melezhik yes I am aware ... 22:46
and here the case with github.com/melezhik/sparrow-plugin.../go.mod#L5 - it's pure go implementation for sqlite3 22:47
at least I expect that ... ))
El_Che it is
melezhik yeah, so the idea is to use pure go things to avoid hassle with dependencies on target server ... it's all of course at coast of coding on go some things ... 22:48
but Sparrow already take cares about many others - like input parameters handling and configuration
for example like here - github.com/melezhik/sparrow-plugin.../task.bash 22:49
coast -> cost 22:56
22:57 gordonfish joined 22:58 brtastic left 23:12 bazzaar left 23:15 tobs joined
notagoodidea Is there another way to check if a substring appears in an array of string than : 23:15
m: my @foo = ["foo bar", "baz lala"]; .say if $_ ~~ /foo/ for @foo; 23:16
camelia foo bar
codesections m: my @foo = ["foo bar", "baz lala"]; say @foo.grep: /foo/ 23:19
camelia (foo bar)
codesections same basic idea, but slightly more readable, imo
notagoodidea agreed, thanks! 23:24
sortiz m: ["foo bar", "baz lala"].first(/foo/).Bool.say; #Ready for your "if" 23:26
camelia True
sortiz m: ["foo bar", "baz lala"].first(/gol/).Bool.say; 23:27
camelia False
notagoodidea first only try on the first item of the array no? 23:28
sortiz Nop, returns the first match if any or nil 23:30
notagoodidea m: ["foo bar", "baz lala"].first(/baz/).Bool.say; 23:31
camelia True
sortiz So, I you only want to check if the substring appears, it stop early
notagoodidea That answered another question, I had :D 23:47
melezhik El_Che here is the final implementation of the idea, if you're interested - sparrowhub.io/plugin/sparky-db/0.000001 23:50
.tell tib I've create a simple Sparrow plugin tom list sparky builds, it's built on go and does not require any dependencies . It's very simple but illustrate the idea - sparrowhub.io/plugin/sparky-db/0.000001 23:51
tellable6 melezhik, I'll pass your message to tib
23:55 Doc_Holliwood left 23:58 melezhik left 23:59 Xliff joined