🦋 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.
nosqrt gay 10:56
lizmat raku *is* fun :-) 10:58
rba Just to let you know I've renamed the meetup group to "Swiss Raku and Perl Community". www.meetup.com/Swiss-Raku-Perl-Com...ty-Meetup/ 11:21
And there will be a "Swiss Raku and Perl Miniconf 2020" in Switzerland. Stay tuned... 11:22
jnthn Ooh...tempting, so long as the dates work :) 11:28
rba moritz: You're so quick. retweeted... 11:29
moritz rba: I'm either quick or miss it entirely :D 11:56
rba moritz++
cpan-raku New module released to CPAN! Audio::Liquidsoap (0.0.8) by 03JSTOWE 12:13
tyil /b 62 14:14
woops
leont m: say Order("Same") 14:15
evalable6 (Order)
leont That is a bug right? That should return an Order::Same?
tobs I'm not sure if that isn't intended or if it's just not implemented. 14:25
m: say Order(1) # converting the value representation of the enum works 14:26
evalable6 More
tobs m: say Order::<Same> # key lookup exists like this
evalable6 Same
leont In my scenario I get Order in a variable, so Order::<> isn't available to me 14:28
moritz m: my $name = 'Order'; say ::($name):: 14:29
evalable6 (Order)
moritz m: my $name = 'Order'; say ::($name)::.keys
evalable6 ()
moritz m: my $name = 'Order'; say ::($name)::<>
evalable6 (Order)
lizmat leont: is this specifically about Order, or more about enums in general ? 14:30
if about Order: then check it numerically 14:31
m: dd Same == 0
evalable6 Bool::True
lizmat m: dd Less == -1
evalable6 Bool::True
lizmat m: dd More == 1
evalable6 Bool::True
leont Apparently enums in general 14:36
Given I type object, I want to be able to convert strings into values of that enum, or die trying
lizmat hmmm..... 14:39
jnthn Order(...) only expects the enum value, not its name; we shouldn't confuse those two, othewise things will get really weird on string-based enums 14:40
m: my $name = Same; dd Order::{$name} 14:41
evalable6 Order::Same
jnthn Do it like that to find it by name
lizmat jnthn: I think the actual enum type can only be derived from a value in a variable in leont 's case 14:43
leont Yeah, I have a $order = Order as a starting point 14:44
lizmat m: m: my $name = Same; dd $name.WHAT::{$name}
evalable6 Any element{'Same'} = Any
lizmat leont: is that what you mean, or am I misunderstanding ? 14:45
leont I have «my $order = Order; my $name = "Same";», I want to make Order::Same out of that 14:46
lizmat jnthn: ^^ 14:47
tobs m: my $order = Order; my $name = "Same; dd $order($order.enums{$name}) 14:48
evalable6 (exit code 1) 04===SORRY!04=== Er…
tobs, Full output: gist.github.com/70f7bdc39d05398179...2ae18ba1cc
tobs m: my $order = Order; my $name = "Same"; dd $order($order.enums{$name}) 14:49
evalable6 Order::Same
tobs doesn't win a succinctness prize though
leont tobs++
jnthn m: my $enum = Order; my $name = 'Same'; dd $enum.WHO{$name} 14:52
evalable6 Order::Same
tobs oh neat 14:56
lizmat jnthn++ # duh! 14:57
m: my $enum = Order; dd $enum.WHO.keys
evalable6 ("More", "Same", "Less").Seq
daxim do we have a (directed) graph module? need to find all nodes that are not successors to a certain node. I don't want to code it myself if it can be helped 14:58
jnthn I don't think so. I did implement such a think as a util in some project a while back, but it only had a couple of algorithms that I needed. 14:59
Did think to release it at some point and enjoy implementing a bunch more graph algos along the way, but...as usual, too many things to do. 15:00
jaldhar Hello. I missed a couple of the weekly challenges over Christmas so I'm going back and doing them now. I did challenge 038 and ran into an interesting situation. 15:02
Am I right in thinking there is no way to return "undef" from a grammar action class?
You can return Nil (and I did) but it is not the same thing. 15:03
leont Seems I can't add a returns trait whose type argument is a value? «sub foo() returns($type) {}» 15:05
Working around it for now by calling trait-mod:<returns>(&foo, $type), it feels a bit clunky 15:06
jnthn Only if $type is a constant (and so available at compile itme)
Since traits are applied at compile time
leont Right, that does make sense
trait-mod:<returns>(&foo, $type) it is then
jaldhar The reason why one would want that is that you can test if a grammar parsed correctly by $parsed = $grammar.parse(); if $parsed... but if you add extra validation in an action class, you end up having to do $parsed = $grammar.parse(); if $parsed && $parsed.made which is unsightly. 15:09
Not a huge problem as things go but I was wondering about this. 15:10
jnthn jaldhar: The return values of grammar actions are ignored; only `make` is useful for attaching anything
jaldhar jnthn: So I used make Nil to signify that validation has failed. But ideally I would want make undef. It does not seem to be possible. 15:11
jnthn There is no undef 15:12
jaldhar There should be some way of saying this AST (or match object?) is empty. After all isn't that what you get if you fail a regex or a grammar without actions? 15:14
jaldhar IIRC in yacc grammars there is a routine you can specify to mean "Game over man. halt parsing." I'm surprised there doesn't seem to be a simple way to do that in Raku. 15:18
lizmat die ? 15:20
grammars are just code
jnthn If you don't call `make` then you won't have set a .made. But ultimately there's two levels here: the parse tree and the AST. 15:21
jaldhar lizmat: would that exit out of the grammar parse or out of the script altogether? But I just remembered that Raku has exceptions. Maybe throwing an exception is the right way to do this? 15:23
lizmat put a CATCH block in the same scope as where you do the parse 15:24
lizmat m: CATCH { say "reviving"; .resume }; die; say "alive again" 15:25
evalable6 reviving
alive again
jaldhar lizmat: ok just read about all that. die is how exceptions are thrown and CATCH {} is how they are caught. 15:26
jaldhar Well, I had solved my initial problem but I shall file this away in brain for future reference. 15:27
jaldhar Thanks jnthn and lizmat 15:28
lizmat jaldhar: please note that "die 'foo'" is just short for X::Adhoc.new("foo").thriow
*throw 15:29
lizmat if you make your own Exception class, you can actually put information in there that you could use in the CATCH block to react 15:29
Geth ecosystem: d982779fc8 | ven++ (committed using GitHub Web editor) | META.list
Add JSON::Mask and Badger
15:32
jaldhar lizmat: yes there is some neat stuff there but I need to look into it more. Unfortunately, if a topic is not covered in Laurents' book I don't know about it! 15:34
Geth doc: 98a1a09152 | Coke++ | xt/words.pws
learn new word
16:46
holli how do i write a generic class in Raku? class f[::t] {} doesnt compile 16:58
Altai-man_ holli, you write generic roles with role Foo[::T] { ...something with T... } and then `class Bar does Foo[Int] { ...use things from Foo role... }` 17:01
holli wait, you can use a role from the body of the class? 17:02
leont Apparently you can do this with a «method ^parameterize», not sure if that's in the spec though
jnthn Sorta, but please just write a role.
Altai-man_ holli, can you share a simple pseudocode sample of what you want so we could help with it? 17:03
leont Fair enough
holli in the end i would like my @linked-list[Something] = (Something.new(1), Something.new(2), Something.new(3) ); @linked-list.add-node(2, Something(4) ); 17:04
basically implement a linked list and make it look and behave like an array/hash 17:05
i'm just pondering ideas for the weekly challenge
jmerelo holli: you can also "pun" or directly instantiate that kind of parametrized roles. 17:06
tbrowder hi, #raku peeps 17:48
Geth rakudo.org/star-2020.01: 9a2e3942f5 | (Patrick Spek)++ | post/announce-rakudo-star-release-2020.01.md
Add release announcement for Rakudo Star v2020.01
17:49
rakudo.org: Tyil++ created pull request #35:
Add release announcement for Rakudo Star v2020.01
tbrowder i notice lots of perl6 references still in the docs. are they fair game for changes, or is there a master plan for them i'm not aware of? 17:50
Geth doc: tbrowder++ created pull request #3231:
document new raku environment variable RAKUDO_POD_DECL_BLOCK_USER_FORMAT
18:03
Geth doc: c578022763 | (Tom Browder)++ | doc/Language/pod.pod6
document new raku environment variable RAKUDO_POD_DECL_BLOCK_USER_FORMAT
18:17
doc: 4b2f347ab1 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Language/pod.pod6
Merge pull request #3231 from tbrowder/user-fmt

document new raku environment variable RAKUDO_POD_DECL_BLOCK_USER_FORMAT
linkable6 Link: docs.raku.org/language/pod
Geth doc: tbrowder++ created pull request #3232:
chg p6 to raku
18:30
AlexDaniel` ehhh 18:32
where's the latest rakudobrew?
here I think github.com/Raku/App-Rakubrew
but nothing links to it
Geth doc: tbrowder++ created pull request #3233:
chg pe6 to raku
18:36
Geth doc: tbrowder++ created pull request #3234:
chg p6 to raku
18:41
doc: 0aa06f65b2 | (Tom Browder)++ | doc/Language/5to6-nutshell.pod6
chg p6 to raku
doc: fbb791c6eb | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Language/5to6-nutshell.pod6
Merge pull request #3232 from tbrowder/p6toraku-5to6-nutshell

chg p6 to raku
linkable6 Link: docs.raku.org/language/5to6-nutshell
jmerelo AlexDaniel`: that's rakubrew, the next rakudobrew
AlexDaniel`: rakudobrew should be in tadzik's repo.
jmerelo github.com/tadzik/rakudobrew 18:41
Geth doc: 07d0438e5f | (Tom Browder)++ | doc/Language/5to6-perlsyn.pod6
chg p6 to raku
18:42
doc: e54a83b007 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Language/5to6-perlsyn.pod6
Merge pull request #3234 from tbrowder/p6toraku-5to6-perlsyn.pod6

chg p6 to raku
linkable6 Link: docs.raku.org/language/5to6-perlsyn
Geth doc: tbrowder++ created pull request #3235:
chg p6 to raku
18:59
Geth doc: 5d3ddc8784 | (Tom Browder)++ | doc/Language/5to6-perlsyn.pod6
chg p6 to raku
19:03
doc: 8cab3ae9eb | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Language/5to6-perlsyn.pod6
Merge pull request #3235 from tbrowder/p6toraku-5to6-perlsyn

chg p6 to raku
linkable6 Link: docs.raku.org/language/5to6-perlsyn
Geth doc: tbrowder++ created pull request #3236:
chg p6 to raku
19:04
[Coke] Would anyone like to be able to deal with parquet files in Raku? 19:09
Geth doc: 9a263ebe0d | (Tom Browder)++ | doc/Language/about.pod6
chg p6 to raku
doc: 3023b5d5f4 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Language/about.pod6
Merge pull request #3236 from tbrowder/p6toraku-about

chg p6 to raku
linkable6 Link: docs.raku.org/language/about
Geth problem-solving: tbrowder++ created pull request #165:
update reference
19:13
Geth doc: tbrowder++ created pull request #3237:
chg p6 to raku
19:21
doc: 46919e255f | (Tom Browder)++ | doc/Language/community.pod6
chg p6 to raku
19:26
doc: 814b818df1 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Language/community.pod6
Merge pull request #3237 from tbrowder/p6toraku-community

chg p6 to raku
linkable6 Link: docs.raku.org/language/community
Geth doc: 8f612b4d0b | Coke++ | xt/words.pws
learn new fragment
20:00
Geth rakudo.org: 9a2e3942f5 | (Patrick Spek)++ | post/announce-rakudo-star-release-2020.01.md
Add release announcement for Rakudo Star v2020.01
20:15
rakudo.org: 78a9a29541 | (Patrick Spek)++ (committed using GitHub Web editor) | post/announce-rakudo-star-release-2020.01.md
Merge pull request #35 from perl6/star-2020.01

Add release announcement for Rakudo Star v2020.01
Geth rakudo.org: da6813dce2 | (Roman Baumer)++ (committed using GitHub Web editor) | templates/star.html.ep
update 'static' version number for rakudo star

from 2019.03 to 2020.01
20:28
Geth rakudo.org: b84feb9016 | (Patrick Spek)++ | post/announce-rakudo-star-release-2020.01.md
Fix up a few typos
20:37
rakudo.org: 1b55ab29c9 | (Patrick Spek)++ | templates/star.html.ep
Merge branch 'master' into star-2020.01
Geth rakudo.org: 41d873f395 | (Patrick Spek)++ | post/announce-rakudo-star-release-2020.01.md
Remove reference to alerts.perl6.org
20:40
Geth raku.org/star-2020.01: c09575542e | (Patrick Spek)++ | source/downloads/index.html
Update downloads page for Rakudo Star 2020.01
20:47
raku.org: Tyil++ created pull request #144:
Update downloads page for Rakudo Star 2020.01
20:48
Geth doc: tbrowder++ created pull request #3238:
chg p6 to raku; add onfo on kebab case
20:59
Geth doc: tbrowder++ created pull request #3239:
chg p6 to raku
21:16
Geth doc: tbrowder++ created pull request #3240:
chg p6 to raku
21:21
lizmat and another Rakudo Weekly News hits the Net: rakudoweekly.blog/2020/02/24/2020-...red-noise/ 21:37
Geth raku.org: c09575542e | (Patrick Spek)++ | source/downloads/index.html
Update downloads page for Rakudo Star 2020.01
21:43
raku.org: e64241cfe6 | (Patrick Spek)++ (committed using GitHub Web editor) | source/downloads/index.html
Merge pull request #144 from Raku/star-2020.01

Update downloads page for Rakudo Star 2020.01
doc: tbrowder++ created pull request #3241:
chg p6 to raku
21:50
doc: tbrowder++ created pull request #3242:
chg p6 to raku
21:56
doc: tbrowder++ created pull request #3243:
chg p6 to raku; chg '.perl' to '.raku'
22:13
cfa 👋🏽 22:38
Geth doc: tbrowder++ created pull request #3244:
chg p6 to raku; chg '.perl' to '.raku'
22:45