🦋 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.
ergergrdf which time is it, in your location ? 00:00
Good night 00:07
guifa I think I remember once jnthn (or maybe lizmat) saying that attribute access will always be faster than hash access. Is the same true for array access? 03:25
tony-o_ .seen melezhik 05:25
tellable6 tony-o_, I saw melezhik 2020-01-21T19:48:12Z in #raku: <melezhik> `curl -d project=melezhik/Tomty -d os=debian repo.westus.cloudapp.azure.com/raku...n/:github`
tony-o_ .tell melezhik would be happy to discuss more, lmk next you're online
tellable6 tony-o_, I'll pass your message to melezhik
Geth doc: 5ed062f27e | (Stoned Elipot)++ | doc/Language/operators.pod6
Fix link target
06:16
alipoor90 rakudo doesn't have -i option for in-place editing? 10:38
kawaii Is anyone able to help figure out what is wrong with our META6 file prevening install via Zef? :) 12:21
github.com/shuppet/p6-api-discord/...META6.json
someone suggested that git-based source-url's are no longer supported, but I can see other common modules using the same format
sena_kun kawaii: and those modules are installed ok? :) 12:30
the format is incorrect indeed, something like github.com/croservices/cro-core.git works just nice, replace the user and repo name and it'll be ok
kawaii sena_kun: yes, URI::Encode is one of them using the git: format
sena_kun lemme see... 12:31
kawaii But I'll try your suggestion once I'm back on my laptop :)
sena_kun kawaii: maybe because Encode::URI has `/` and your url uses `:`? 12:32
I mean, [email@hidden.address] (note the colon) and "git://github.com/perl6-community-modules/URI-Encode.git". 12:33
this `:` looks suspicious to me
kawaii ah that might be the issue
good catch 12:34
sena_kun: I'm still getting a failure :( 12:43
zef isn't exactly very verbose about saying why
tyil kawaii: zef has a --verbose flag, can you try that? 14:17
tbrowder hi, #raku people \o 14:20
i have a db program that manipulates a text database (flat file) and inserts it into either a postgres or sqlite db 14:21
currently i have to edit the prog with =begin/=end comment lines to select the module being used and the db commands which is not very elegant. 14:24
is there a way programmatically to select between the two? 14:25
off the top of my head i guess i should first isolate the db lines into their own modules. 14:27
then somewhere use a require statement to select the correct module for the desired db to use. 14:28
i should make the module interfaces the same.
lizmat tbrowder: github.com/FROGGS/p6-if 14:29
kawaii tyil: interesting, looks like I just had to wait a while but now I get a slightly different error www.irccloud.com/pastebin/y2lnsh8L/
tyil kawaii: looking at the META6.json, I'd say you're missing a protocol, and the git url used is incorrect 14:31
tbrowder lizmat: thnx!
tyil but looking at the scrollback I see people saying git:// is no longer accepted
`git://github.com:shuppets/p6-api-discord.git` is what I would expect 14:32
or `github.com/shuppet/p6-api-discord`
in any case, I would strongly suggest creating a tarball out of it, and using CPAN 14:33
kawaii I don't really understand CPAN, I was never much of a perl5 guy :( 14:34
but thanks, looks like this should work now
tyil there's modules that can help you with that part, if desired :)
kawaii it would probably be a good idea, can you link something for me to read? :)
tyil I'm biased in favour of App::Assixt, but I'm not even sure if it works on any system that isn't mine. I'ev heard of people using mi6 as well 14:35
lizmat modules.raku.org/dist/App::Mi6:cpan:SKAJI
is what I use :-)
but that's mainly because that was around before App::Assixt was
tyil I don't have any good documentation on how to upload to CPAN manually, the docs I found when I was making my own modules were... not very beginner friendly
kawaii I'll try both and see which suits my workflow better, thanks :) 14:36
lizmat I've had about 100 Perl modules on CPAN, and never had to upload manually :-)
kawaii lizmat++
tyil++
tyil good luck ^_^
rypervenche So I asked this question yesterday and didn't get an answer. I'm going to try again, but it might be a stupid question. I noticed I could change a for loop into a single line using X. I'm curious to know if anyone would recommend using this more idiomatic way of expressing this or not. gist.github.com/rypervenche/d15053.../revisions 15:33
lizmat m: my @letters = <a b c>; my $password = "abd"; say $password.comb.Set eqv @letters.Set 15:37
camelia False
lizmat m: my @letters = <a b c>; my $password = "acbcbba"; say $password.comb.Set eqv @letters.Set
camelia True
lizmat rypervenche: ^^ something like that ?
rypervenche lizmat: So @char-sets is an array of sets that I want to loop through, essentially. So long as at least one character from my password is in each set then it's good. 15:39
lizmat ah, an additional level of indirection 15:41
I guess I would create a hash with char -> Set mapping 15:42
and then change $password.comb.Set to $password.comb.map( { %char2set{$_} } ).Set 15:44
rypervenche Ah, so you wouldn't do it either of my ways, haha. I'll try this out. Thanks. 15:45
lizmat m: my %c2s = a => 1, b => 1, c => 2; my $password = "abababab"; say $password.comb.map( { %h2s{$_} } ).Set eqv (1,2).Set 15:46
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '%h2s' is not declared. Did you mean '%c2s'?
at <tmp>:1
------> 3= "abababab"; say $password.comb.map( { 7⏏5%h2s{$_} } ).Set eqv (1,2).Set
lizmat m: my %c2s = a => 1, b => 1, c => 2; my $password = "abababab"; say $password.comb.map( { %c2s{$_} } ).Set eqv (1,2).Set 15:47
camelia False
lizmat m: my %c2s = a => 1, b => 1, c => 2; my $password = "ababababc"; say $password.comb.map( { %c2s{$_} } ).Set eqv (1,2).Set
camelia True
lizmat of course, the %c2s initialization could be done programmatically from your array of sets :-)
rypervenche Would eqv work though since my sets have "all possible characters of a certain type" and my password would only have some of them? 15:49
lizmat the hash should map all possible characters of a set to a single value 15:50
it's only *those* values that we check
m: dd (1,2,2,3,4).Set eqv (1,2,3,4).Set 15:51
camelia Bool::True
lizmat m: dd (1,2,2,4).Set eqv (1,2,3,4).Set
camelia Bool::False
rypervenche Interesting. I'll see if I can make that work then. Thanks again.
lizmat I guess you could also use (>=) or (<=) but I find eqv to be better expression what you want 15:52
rypervenche So the way I set mine up with the (elem) is unnecessarily convoluted then? 15:55
lizmat convolution is in the eye of the beholder, I merely looked at what I understood to be the desired outcome and how *I* would do it 15:56
if you're interested in how each solution performs, I suggest you benchmark it :-) 15:57
lizmat if you're not, then you should go with whatever will be best maintainable for you :-) 15:57
rypervenche Ok. I'm still very new to this (coding in general) and am a perfectionist. I'm really liking the multiple ways to do something thing, but also like having a "best" way to do something. I'll try out the hash way and see how I like it. 16:01
lizmat it's just learning to ride a bike :-) 16:08
*like
japhb rypervenche: Are you familiar with the concept of the "Pareto frontier"? If not, in short: If you have more than one dimension on which you can optimize, then you will often get situations in which it is impossible to improve *all* of those dimensions simultaneously. There is quite often no *single* best way to do something, but there is often an identifiable "edge" to the space of possibilities where each 16:10
choice on that edge ("frontier") is the best it can be on some dimensions without making any other dimensions worse.
rypervenche I know I'll learn better ways to do things as I use the language as well. This channel's been very friendly and helpful, which is very welcoming.
japhb In other words, if you care about more than one thing, you are usually forced to trade off, but still have an identifiable set of "better" choices. 16:11
lizmat
.oO( cheap, good, fast: pick any 2 :-)
16:12
rypervenche Haha. Makes sense. 16:13
guifa lizmat you mean <cheap good fast>.pick: 2 :-) 16:19
lizmat m: say <cheap good fast>.pick: 2
camelia (good cheap)
lizmat that's Raku for you :-)
rypervenche Hahaha
Poohman hello all, is there a way to define a complement of a token in a grammar 17:01
like \n and \N
jmerelo Poohman: in many cases, just ! at the beginning. Like <!token> 17:02
Poohman jmerelo: thanks
jmerelo Poohman: sure :-)
uzl[m] Hi everyone! I've written this small article(?), uzluisf.gitlab.io/posts/2020/subro...or-method/ . Would appreciate if someone could proofread it. 17:07
jmerelo uzl[m]: no time, but great job :-) 17:18
samebchase- uzl[m]: The monospace font seems to be a little smaller than the text. The article is good. 👍 17:21
lizmat uzl[m] re "A routine can be both a subroutine and a method in which case you can call it using the subroutine call syntax and method call syntax respectively." 17:47
with the following example: those are not the same thing being called
the first is a 'sub say' the latter is the method "say" on the Str object 17:48
so I think that example is confusing in light of what you're saying next: which is that you can call a sub as a method 17:49
the example would imply that you do *not* need the extra syntax
lizmat uzl[m]: are you aware of .grep( &grepper, :k) ?? 17:52
lizmat m: dd <a b b c c c d d d a a>.grep( * eq "c", :k ) 17:53
camelia (3, 4, 5).Seq
hsmyers how do I join the documentation project?
El_Che hsmyers: clone the repo, send PR's 17:58
hsmyers: once you know your way around, you'll be able to commit to the repo 17:59
hsmyers take big bite and then nibble
El_Che if you have something specific in mind, jmerelo is something interesting to talk about it 18:00
bbl 18:01
hsmyers No, can't disaprove of something I'm part of :)
hsmyers On another topic is it possible to stop a token by sending a fail from code? 18:03
tbrowder lizmat: turns out the if module is for compile time use. i had to use "require" and then painful dynamic lookups for choosing the module as an input arg 18:13
tbrowder but it works 18:14
lizmat but, the check is dependent on command line args, no ?
tbrowder not as i read the use of "if"
lizmat I mean, how do you specify which version you want, as a command line parameter ? 18:15
tbrowder i created a var that is default true to use DB::Pg. then an input arg can change that to false in which case i require DB::SQLite instead. then, after the if/else i assign to local vars the values from exported symbols in the selected modules (if that makes any sense). the docs section on PACKAGES shows how to do it 18:18
tbrowder "use DB::Pg" should read "require DB::Pg", same for DB::SQLite 18:20
DrForr Howdy! I'm gathering ideas for Raku demo snippets that we can put on our new FOSDEM banner.
tbrowder it's pretty slick, but the syntax is a bit tricky 18:21
lizmat tbrowder: I see... well, if you have an idea for a better idea for syntax, please make a problem solving issue 18:25
DrForr: (1..Inf).grep( *.is-prime ).skip(999).head # the 1000th prime number 18:26
DrForr I'll of course replace Inf with the bloody Unicode symbol... 18:27
[Coke] ∞ if you need a copy. :)
DrForr Heh. I was just going for the Character panel. 18:28
lizmat DrForr: elements of a list not occurring in the second list: say (1,2,3,4,5) (-) (4,3,1)
m: say (1,2,3,4,5) (-) (4,3,1)
camelia set(2 5)
DrForr I've got some sigilless examples, unicode sigma, postfix !... 18:29
I'm already doing two (-) fib # to show the numbers that occur in both...
lizmat m: say 42 (elem) 1..100
camelia True
lizmat tbrowder: would it be terrible to load both modules, and then during execution select the class ? 18:30
DrForr I'm tempted to show off numerics with the Bernoulli numbers... 18:31
Also, what are the Unicode characters used to generate the flag symbols you use on slides 18:33
s/$/?
tbrowder well, they aren’t classes but i thought about that but didn’t go with it because i thought that would take more work, 18:34
tobs I find the R metaop and junctions particularly cool, but can't come up with some shining example
DrForr I had one on a slide where I deliberately used it to get rid of a paren, but it wasn't worthwhile. 18:35
tbrowder but that’s probably the best thing to do.
lizmat DrForr: something about throwing dice 18:36
tbrowder maybe i’ll do that someday after my todo list is empty! 18:37
lizmat m: say <1 2 3 4 5 6>.pick(3)
camelia (4 5 1)
DrForr Something like (1..6).pick then...
lizmat with the dice symbols
DrForr Oh, (('A',1...9,'J','Q','K') Z <C D H S>).pick 18:38
(2..10 that is)
lizmat m: say ("⚀" .. "⚅").pick(3) 18:39
camelia (⚂ ⚀ ⚁)
lizmat m: .say for ("⚀" .. "⚅").pick(3)
camelia

tobs m: if [eq] ("⚀" .. "⚅").roll(5) { say "yahtzee!" } 18:40
camelia ( no output )
guifa uzl[m]: I enjoyed it. I also kind of wish more people would get used to the “method object: args” (method as sub) calling structure, because I use it a fair amount and I feel like I’m the only one ha 18:41
hsmyers @tbrowder a URL for your load method? I'm looking at docs.perl6.org/language/packages and not seeing anything (but I'm a newbie therfore blindish) 18:43
lizmat am I missing something, but isn't that just syntactic sugar for 'object.method: args' ?
guifa lizmat: yeah. But sometimes if I have a series of sub calls, it just visually looks better to write it the other way around because then I can more easily line up elements 18:47
lizmat ok, fair enough... :-)
guifa It’s nice though that you have the option, just like postfixed if/for/etc. Exactly the same at the core, but help promote readability / emphasis when you need it. 18:49
tbrowder hsmyers: in the PACKAGES section the subsection "interpolating into names" shows how to access objects in loaded packages.
the loading part i got in the modules page, "require" subsection 18:50
guifa also lizmat: I still haven’t had my PAUSE account approved, so I can’t start transitioning my stuff to there =\ Not sure if you have any powers yonder
hsmyers Thanks @tbrowder, missed that! 18:51
tbrowder i think some of the "require" syntax is a bit misleading, and i intend to look into it.
lizmat guifa: pinging some people 18:52
tbrowder all that said, i think lizmat's suggestion of using a class to be selected at run time is better, it certainly will result in cleaner code in the calling script 18:54
lizmat looks like each module load is about 20msecs, not sure how important that is for you 18:55
lizmat guifa: which name have you asked for? GUIFA ? 18:59
DrForr Thanks all, I'm trying to get the banners ready for FOSDEM and we need some quickie examples. 19:03
hsmyers @tbrowder Turns out can't use that/those approaches since I want conditional use of Grammar::Debugger which has to be high up in code chain to work.
guifa lizmat: that’s correct 19:05
tbrowder hm, what condition are you testing? you might check out the "if" module lizmat suggested. 19:06
hsmeyers: ^^^ 19:07
DrForr Hrm, is there a way to make the Argand identity work out? (e**(i*pi))==-1 (it evaluates to very *nearly* -1...) 19:09
hsmyers @tbrowder condition isn't the problem, GD has to be "used" before anything else happens in order to take over like it does. Grammar::Tracer works same way. 19:10
tbrowder yes but did you look at the "if" module? it might do the trick 19:11
hsmyers will now :)
lizmat guifa: all my pings so far unfruitful :-( 19:24
guifa lizmat: no rush, just happened to see you on and figured I’d let you know I’m not ignoring your request :-) 19:25
guifa is currently avoiding his dissertation and making a pretty blue butterfly image for his Fluent module because procrastination lol
jmerelo guifa: procrastination in PhDs so help creativity... 19:27
guifa jmerelo: except when it’s just a matter of writing lol. The fun stuff (trips to archives in your country) is over with now :( 19:28
jmerelo guifa: yep... I'd like to have a look at that when it's published. 19:29
DrForr waves to jmerelo
jmerelo Hey, DrForr
tobs DrForr: pretty sure complex arithmetic always degrades to Num (because it has to). So unless this expression is hardwired into Rakudo, I'm afraid it won't work in a symbolic, lossless way. 19:31
guifa jmerelo: Actually, I wouldn’t mind having you take a look at the tech chapter beforehand. Most of my committee is more oriented towards literary analysis (the bulk of the diss) so they probably can’t catch any smaller mistakes 19:32
DrForr tobs - I figured as much, but it'll let me show off the =~= operator and (more importantly) the Unicode equivalent.
And yeah, I think there are some better closed forms for the Argand expression, but sadly the margin of the banner is too small to contain them. 19:34
guifa tobs: right now at least. One of these days (sadly not anytime soon) I’d like to start adding in a symbolic math engine. Sticking to the basis of square roots, trigs, and pi shouldn’t be tooooooooooooo hard and cover a lot more use cases than the current complex numbers does. 19:35
hsmyers tbrowder, @lizmet, if failed, line 21. Use of uninitialized value of type Any in numeric context…
tbrowder bummer 19:36
can you show the pertinent code in a gist?
hsmyers @tbrowder: my $DEBUGGER = 1; 19:37
@tbrowder, then run… 19:38
Also use if; befor use lib <path>; causes problems… 19:39
tbrowder well, i'm sorry i can't help. i just put '=begin/=end comment' lines around the "use ..." lines 19:41
to turn the debugger code off
hsmyers same here, needs internal magic I think… 19:44
jmerelo guifa: will be delighted. You know my email, feel free. 19:46
Going AFK now. Cheers!
tbrowder lizmat: changed to using classes, much easier than i thought--and much cleaner code (my classes need improving, though--a good refresher) 19:50
lizmat: thnx for the kick!
lizmat tbrowder: yw :-) 19:51
El_Che y(ou)w(easel)
:)
cpan-raku New module released to CPAN! PDF::Font::Loader (0.2.8) by 03WARRINGD
[Coke] We should probably add slightly more info to modules.raku.org/search/?q=PDF%3A%...A%3ALoader so it's clear why there are two responses that look so similar. 19:55
(I think it's: one is an official CPAN release, the other is "what github has")
guifa [Coke]: I think all that has to be done is remove it from the github ecosystem page, and then it’ll get removed from the scrap (I think). I know I’ve seen a few edits to the ecosystem page for that reason 20:01
[Coke] I could see wanting both, but also it'd be nice to know at a glance which kind of module it was (cpan "released" or github "latest") 20:06
so even if in that case one was removed, knowing what kind was left might be nice
guifa Or even merging them into a single entry, with a link for CPAN and for Github. Some small text could alert that CPAN = release, Github = most recent / pot unstable 20:08
pasteboard.co/IRlkZoN.png <— not camelia this time, but seriously, anyone who hates Camelia just doesn’t realize how much stuff can be done with butterflies 20:09
El_Che guifa: I like butterflies but dislike camelia. It's not the same thing :) 20:11
lizmat guifa: I like it :-) 20:13
El_Che guifa: they can even be used as ninja stars: www.thetvjunkies.com/wp-content/up...ldaITB.gif
El_Che guifa: is a nice image. If you accept postive critique, I would change the "for Raku" font and he light blue blackground. 20:14
The lower part of the butterfly could be darker, I think 20:15
guifa El_Che: I did think about the font and I might still change it. I’ve been fairly consistent in all the images so far with using Courier for the “for Raku” bit, but I s’pose I don’t need to actually be that consistent
El_Che Thing is that everthing else is fliud 20:16
background, smoke, round wings, fluent font
so "for Raku" feels copy pasted
guifa is definitely willing to make some for other modules. Imagine if searching Modules in modules.raku.org had cool images
El_Che totally out of place
guifa: I like how the butterflies feels calm and steady and the smoke wild and unpredictable 20:18
great opposition
uzl[m] lizmat: re Regarding the "extra syntax", would it be better to remove the example altogether or replace it with something else? Or probably rephrase the sentence? 20:20
lichtkind is there a inf for Int?
uzl[m] No, I wasn't aware you could use grep that way 😅😅 (I'll leave the example and mention the same thing can be achieved with grep). 20:21
jmerelo, samebchase : Thanks. Will try to increase the font size. 20:22
lizmat uzl[m] My "issue" is that the example is not an example of the situation you're describing with 'sub multiply'
there *is* a "sub say" and a method "Any.say"
guifa El_Che: I tried doing a plain white before, but it didn’t work as well as I would have liked =\ I adjusted the fonts and did some levels adjustment on the butterfly. Looks much better thanks! 20:23
El_Che guifa: it's always handy to have people with artistic skill in a project 20:25
sometime a good illustration make boring pages pop
guifa I’ve been toying with the idea of going through the most common modules and making similar images. (aka “more ways to procrastinate”) 20:28
samcv Tomorrow evening Europe time we will be having a video call with everyone, so please PM me if you want to be a part of it! 20:30
lizmat samcv: part of what ? :-) 20:31
samcv the video call. and/or the conference. There's plenty of things that can be done remotely especially at this stage. 20:33
lizmat ok, so about the Perl & Raku Conf in Amsterdam :-) 20:37
samcv oh i notice how i didn't say what it was about. Thanks lizmat 20:55
lucs Precomp problem: gist.github.com/lucs/bf0e5374cfd6e...d81fcf7a36 21:33
melezhik This how one can customize Raku modules installation/test process for example one need to handle external none Raku dependencies - github.com/melezhik/rakudist-teddy.../README.md 21:34
tellable6 2020-01-23T05:25:27Z #raku <tony-o_> melezhik would be happy to discuss more, lmk next you're online
melezhik `curl -d os=alpine -d project=melezhik/rakudist-teddy-bear repo.westus.cloudapp.azure.com/raku...n/:github` 21:35
repo.westus.cloudapp.azure.com/raku...814866.txt 21:36
[Coke] samcv: thanks for working on the con, I know that's a lot of work and you don't really get to enjoy the con when it happens! 21:46
lucs How the * does precompilation work? Every once in a while, my code trips up on precomp related stuff and I have no idea how to fix it. 21:48
DrForr Yes, thank you very much for stepping up!
lizmat lucs: feels a doc issue is in place ? 21:49
lucs lizmat: I vaguely remember someone recently working on some precomp docs. Not sure where/what/who though. 21:50
lizmat patrickb ?
lucs Really can't remember :/
In the meantime: gist.github.com/lucs/bf0e5374cfd6e...d81fcf7a36 21:51
[Coke] lucs: (precomp) if your goal is to learn how it works, I'd tag @niner.
[Coke] and if it's figure out how to work around a bug... 21:52
is Lucs::Volumes something I can install with zef?
lucs No, sorry.
(Hmm... I'll try reinstalling it here. Who knows...) 21:53
[Coke] realizes he doesn't have p6doc installed.
DrForr Aaah, p6doc is what I was looking for a few nights ago while rewriting stuff... 21:54
guifa2 lizmat: success! I'm registered on PAUSE. I'll try to get at least Carp uploaded by this weekend and probably do my other modules as I get big updates 22:07
lizmat guifa2++
guifa2 thanks for the help! 22:07
lizmat you're welcome
toddr FYI the first round of talk acceptance for TPRC::NA is Sunday - www.papercall.io/tpcihcfp 22:26
pmurias [Coke]: re bootstrapping a new backend I'm not aware of any such docs 22:49
[Coke] pmurias: ah well. Danke 23:11