🦋 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.
cpan-raku New module released to CPAN! Red (0.1.5) by 03FCO 00:11
cpan-raku New module released to CPAN! File::Temp (0.0.7) by 03RBT 00:19
cpan-raku New module released to CPAN! File::Temp (0.0.8) by 03RBT 03:50
Geth doc: 9d7121c6ee | (Luis F. Uceta)++ | 2 files
Fix some links to Language pages
06:12
doc: 4cc4aa5c9d | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | 2 files
Merge pull request #3157 from uzluisf/master

Fix some links to Language pages
jmerelo releasable6: status 07:02
tellable6 2020-01-12T18:34:22Z #raku <tbrowder> jmerelo: maybe you can fix that. but how do we get everyone to the new site without a redirect? make a redirect from old site to new one? the whole thing sounds like a miniature version of p6 -> raku
releasable6 jmerelo, Next release will happen when it's ready. 1 blocker. 0 out of 438 commits logged
jmerelo, Details: gist.github.com/c86dcc4346f34f873e...5f378e18fd
lizmat is looking at mailing list but only gets 500 errors: www.nntp.perl.org/group/perl.perl6...g7648.html 09:24
am I the only one?
eater nope 09:25
`MySQL server has gone away`
lizmat yeah
eater it's out for a little walk
shred_alert Good ol MySQL
lizmat ok, so another part of Perl's infrastructure is showing cracks
:-( 09:26
lizmat will try again in a few hours 09:44
El_Che hi lizmat 09:55
tellable6 2020-01-07T18:27:36Z #raku <jmerelo> El_Che Hope so, also. If not, the talk would be too short. Raku is not Minimalistic. That's it. (well, not experimental any more, either)
Geth ¦ problem-solving: lizmat assigned to jnthn Issue Add Str.(r)index(@needles) github.com/Raku/problem-solving/issues/148 12:09
Doc_Holliwould Mohammad are you here? 12:28
The weekly challenge is usually very vague, but I can't make sense of this weeks #1 12:29
lizmat yeah, the olympic ring challenge is more about riddle solving, rather than programming it seems 12:32
@PerlWChallenge on Twitter responds pretty quickly, usually :-) 12:33
Doc_Holliwould am i missing something or is there really no builtin way to find the index of some array element? 13:08
tyil can I make a MAIN argument be Bool or Str? 13:09
I want to be able to specify --foo *or* --foo=value 13:10
lizmat m: say <a b c d e f g>.first("d",:k) 13:14
camelia 3
tyil seems like I can `where * ~~ Bool|Str` 13:15
lizmat Doc_Holliwould ^^^
scimon I poked Mohammed about the challenge and got him to update the picture so it's a bit more understandable.
tellable6 2020-01-07T17:02:45Z #raku <tobs> scimon: I think this candidate (from the docs) catches the 2 exponent and does floating-point exponentiation which introduces the noise, instead of doing i*i: multi sub infix:<**>(Complex:D \a, Num(Real) \b --> Complex:D)
scimon List.permutations is your friend :) 13:16
Doc_Holliwould tyil: you can also use multi subs with MAIN 13:17
tyil yes, but then I'd have to duplicate a lot of code in two mains
tyil or split up the current MAIN code into a different sub, and call that twice 13:17
scimon That would be my plan :)
Or if it's just about fiddling the inputs (like whether you take a list or a comma seperated string) just call MAIN again with the update. 13:18
mutli MAIN( $a ) { MAIN($a.split(",") }; multi MAIN( @a ) { Do stuff here } 13:19
That kind of thing.
lizmat Doc_Holliwould: was "say <a b c d e f g>.first("d",:k)" an answer to your question? 13:28
Doc_Holliwould lizmat: ah. yes, tyvm
lizmat ok, wssn't sure whether it had caught your eye 13:29
Doc_Holliwould it didnt
lizmat m: say <a b d c d e f d g>.grep("d",:k)
camelia (2 4 7)
lizmat same for grep BTW
jmerelo Just in case you're not in #raku-dev too, the call for projects for students that will participate in Google Summer of Code is open perl-foundation-outreach.github.io...020-ideas/ 13:43
It would be nice to have a good bunch of Raku projects for students to choose.
Kaiepi releasable6, status 14:01
releasable6 Kaiepi, Next release will happen when it's ready. 1 blocker. 0 out of 438 commits logged
Kaiepi, Details: gist.github.com/f7c6052cdaed81b8d8...d287f4a0a9
Geth doc: uzluisf++ created pull request #3158:
Mention immutability of lists on the List page
14:47
uzl[m] o/ A few days ago I decided to talk myself through the concepts of iterables and iterators (especially those in Raku), and ended up assembling this: gitlab.com/snippets/1929111 . It's a bit longish but if anyone could read it and offer some feedback, especially corrections and suggestions for improving it, I'd appreciate it. 14:53
lizmat m: .say for "foobar".comb # uzl[m] maybe something to mention when you say that Str isn't Iterable ? 14:56
camelia f
o
o
b
a
r
lizmat uzl[m]: s/Usualualy/Usually/ 14:58
uzl[m]: re "because afterwards the method can be called as 15:00
many times as desired and the same sentinel value will always be returned."
practically, that's true of many iterators, but the design is really that once an iterator has produced the IterationEnd sentinel, it should *not* be called anymore
any subsequent calls may produce undefined results, or even throw an exception 15:01
on the one hand, this should make iterators easier to implement
otoh, it can make them more difficult to implement :-)
uzl[m]: `while True {` can be written as `loop {` 15:03
"they’re supposed to return
IterationEnd every time pull-one is invoked on them." this is not the design and the contract at the moment :-(
uzl[m]: note that you can obtain the iterator of any `Seq` if it hasn't been used yet 15:05
lizmat uzl[m]: so DNA::iterator can be just: `$!chain.comb.rotor(3).iterator` 15:06
and actually, you don't need the rotor in that case either, as you can tell .comb you want three chars each time 15:07
so it could become `$!chain.comb(3).iterator`
have to be afk now, will look at the rest later 15:08
&
guifa Is there anyway for a sub to access/modify variables in its calling context? (à la string parsing or regex) 15:31
[Coke] . 15:31
tobs guifa: I don't think so. Every applicable pseudo-package requires the variable to be declared dynamic afaics docs.perl6.org/language/packages#P...o-packages 15:52
and other than those, I have no idea how to get a handle on the caller's symbols
jnthn And regex matching setting $/ also follows these rules, and is based on $/ being declared dynamic. 15:54
[Coke] hurls docs.raku.org/language/packages#Pseudo-packages on behalf of jj. 16:04
xinming m: sub a (($a, $b)) { }; &a.signature.perl.say; my $t = -> ($a, $b) { }; $t.signature.perl.say; 16:13
camelia :($ (Any $a, Any $b))
:($ ($a, $b))
xinming Anyone ehre knows, Why will there be difference between these 2?
I thought they were the same.
espcially, the Any $a = $a
jnthn Block arguments take the type Mu by default, whereas Routine ones take the type Any by defaul 16:20
*default
xinming Thanks, got it. 16:22
m: sub a ($a, $b) { }; &a.signature.perl.say; my $t = -> $a, $b { }; $t.signature.perl.say; 16:23
camelia :($a, $b)
:($a, $b)
xinming does this mean, Mu and Any are the "same"?
jnthn Hmm, curious 16:24
m: sub a ($a, $b) { }; say &a.signature.params[9].type
camelia Nil
jnthn m: sub a ($a, $b) { }; say &a.signature.params[0].type
camelia (Any)
jnthn m: my $t = -> $a, $b { }; say &a.signature.params[0].type 16:25
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
a used at line 1
jnthn m: my $t = -> $a, $b { }; say $t.signature.params[0].type
camelia (Mu)
jnthn I guess maybe .perl disregards the difference, maybe depending on what would be the default on the thing the signature applies to
xinming Ok, got it. 16:26
jnthn m: sub a ($a, Mu $b) { }; say &a.signature.perl
camelia :($a, Mu $b)
jnthn m: my $t = -> $a, Any $b { }; say $t.signature.perl
camelia :($a, Any $b)
jnthn Yes, it's trying to be helpful :)
SmokeMachine wouldn't that make sense to always say the type? 16:54
uzl[m] .tell lizmat Thanks! Aside from the note about being able to get an iterator from a unused Seq, I've included all your suggestions. I also created a Github gist; it should make it easier for you if you wish to leave a comment on there. gist: gist.github.com/uzluisf/6faff852ac...aaa944e76d 16:57
tellable6 uzl[m], I'll pass your message to lizmat
[Coke] uzl[m]: There's a "Perl 6" in that gist 17:13
not sure if we should do the rename when referring to articles outside of our docs. 17:14
Doc_Holliwould why can I have a code block as the generator of a sequence but not as a terminator? 17:26
aka, why doesnt this work: 1, 2, { $_ + 1 } ... { $_ < 42 }
scimon Because the final block has will return True after the first element and stop. 17:29
cpan-raku New module released to CPAN! LibXML (0.2.7) by 03WARRINGD
scimon m: say (1, 2, { $_ + 1 } ... { $_ > 42 })[0..5] 17:30
camelia (1 2 3 4 5 6)
scimon m: say (1, 2, { $_ + 1 } ... { $_ > 42 })
camelia (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43)
Doc_Holliwould *facepalm* 17:31
scimon :D
See you later.
Doc_Holliwould cya 17:32
xinming gather/take is really handy when we need lazy list 18:10
AlexDaniel jmerelo: can we start redirecting docs.perl6.org to docs.raku.org? I keep visiting the old site and it annoys me :) 18:41
tellable6 AlexDaniel, I'll pass your message to jmerelo
Doc_Holliwould m: (gather { take 1; take 2; }).map({ .say }) 19:18
camelia 1
2
Doc_Holliwould xinming: it's handy, yes 19:19
I'd still like to have a do method though
cpan-raku New module released to CPAN! Font::FreeType (0.2.1) by 03WARRINGD 19:37
Doc_Holliwould oh yeah? well, if you know so much why don't you go ahead and post a link to it? 19:43
you bot you
srsly, that would be handy
Grinnz i suggested a possible solution the other day but it's a hard problem without knowing where the valid url will necessarily be 19:44
the possible solution being an intermediary service you can link to that will eventually apply the correct redirect 19:45
Doc_Holliwould modules.raku.org/search/?q=Font%3A%3AFreeType would be sufficient for me 20:11
Doc_Holliwould No guessing involved 20:12
@Grinnz
Grinnz that works
lizmat and another Rakudo Weekly News hits the Net: rakudoweekly.blog/2020/01/13/2020-...nt-things/ 21:42
AlexDaniel lizmat: btw why is it rindex and not index :end ? 21:52
lizmat I have no idea, that predates my involvement with Raku 21:53
AlexDaniel greppable6: rindex 21:54
greppable6 AlexDaniel, 129 lines, 26 modules: gist.github.com/4e1096db30cc3dd498...288b58cd2a
AlexDaniel it is used sometimes, but it isn't extremely popular 21:55
maybe we can soft deprecate it or something
if we're changing the behavior a little bit anyway
lizmat we're not changing behaviour, we're adding behaviour 21:56
at least, that's my proposal
AlexDaniel well, yeah, but :end is also “adding” :) 21:58
lizmat true
I'll leave that decision to jnthn :-)
implementation wise, it shouldn't be much of an issue 21:59
Grinnz that reminds me that perl has a rindex and nobody remembers it exists (also probably why raku has it)
or even further back: linux.die.net/man/3/rindex 22:00
lizmat and modules.raku.org/dist/P5index:cpan:ELIZABETH even provides the Perl semantics in Raku 22:01
AlexDaniel looking at things that can behave from both sides we have: head/tail, first/first(:end), index/rindex, starts-with/ends-with 22:03
not a lot of stuff so maybe it doesn't have to be consistent
Grinnz first being the only one with an :end is kind of funny 22:04
AlexDaniel heh, I did know that rindex existed, but I didn't know about indices()
Grinnz: not necessarily, to my eye it's rindex that's kinda weird. head/tail and starts-* are sorta like shortcuts so they can exist like this just fine 22:06
Grinnz in perl we can't have a last since last is already a keyword, not sure if it's the same in raku 22:07
lizmat the other "side" of .first as .end was not an option, as .end was already taken :-( 22:58
bps Tried to install perl6/raku from source using the instructions here: www.raku.org/downloads/ 23:53
Perl6 seemed to install, but got error on zef.
Here's where things seemed to go awry... 23:54
===SORRY!=== Error while compiling /home/bstahlman/rakudo-star-2019.03/home#sources/4166C19B90D62E6DB23143963A5A2C2E658CACB3 (Zef::Distribution)Method 'content' must be implemented by Zef::Distribution because it is required by roles: Distribution.at /home/bstahlman/rakudo-star-2019.03/home#sources/4166C19B90D62E6DB23143963A5A2C2E658CACB3
(Zef::Distribution):5
Any ideas?
After installation completes (with error), the zef binary seems to exist (~/rakudo/share/perl6/site/bin//zef), but attempting to run it, I see the following error: 23:56
AlexDaniel hmmm 23:57
bps bstahlman@bstahlman-HP-EliteBook-840-G2:~/rakudo-star-2019.03$ zef --version===SORRY!=== Error while compiling /home/bstahlman/rakudo-star-2019.03/home#sources/4166C19B90D62E6DB23143963A5A2C2E658CACB3 (Zef::Distribution)Method 'content' must be implemented by Zef::Distribution because it is required by roles: Distribution.at
/home/bstahlman/rakudo-star-2019.03/home#sources/4166C19B90D62E6DB23143963A5A2C2E658CACB3 (Zef::Distribution):5
AlexDaniel bps: I was able to find this: github.com/ugexe/zef/issues/254 23:58
but I don't know if it's relevant
also maybe github.com/rakudo/rakudo/issues/2722