🦋 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.
xinming How do we do early "return" of a block for react block ? 02:31
moon-child I believe 'next' works?
xinming Thanks, that worked. 02:37
tbrowder codesections: yes i am 02:57
samebchase- codesections: how did you get Raku syntax highlighting on your article? 04:19
samebchase- My article is out! raku-advent.blog/2020/12/04/day-4-...-grammars/ 04:34
codesections samebchase-: I used the Acme-Advent-Highlighter: github.com/raku-community-modules/...ighlighter 04:47
(it worked well, though it did slightly mangle links with a ) in the URL) 04:49
Oh, and when pasting it in to WordPress, I initially missed the « ensuring you're editing in "HTML" and not "Visual" mode» step, which made everything break. But after I learned to read a bit better, it worked well :D 04:54
samebchase- codesections: I'm too scared to mess with anything now, but next time I'll be sure to use this 05:06
Geth doc: fcb449ba2f | (Moray Jones)++ (committed by Juan Julián Merelo Guervós) | doc/Language/rb-nutshell.pod6
Changes BUILD to TWEAK in code example

Code example now works using TWEAK instead of BUILD.
Changes description to mentions TWEAK instead of BUILD too.
06:23
doc: 8041a648f4 | (Moray Jones)++ (committed by Juan Julián Merelo Guervós) | doc/Language/rb-nutshell.pod6
Changes twigil to public

There is no reason in this example to show a private attribute.
This clarifies that TWEAK can use $! to access attributes and that it's not a typo, without going into an explanation at this stage.
linkable6 Link: docs.raku.org/language/rb-nutshell
jmerelo Did you check out today's calendar entry? raku-advent.blog/2020/12/04/day-4-...-grammars/ lotsa grammars 06:31
tellable6 2020-12-03T20:32:46Z #raku <tbrowder> jmerelo: when you get a chance, please see if the links i have on build and tweak are satisfactory (the copy on wordpress)
jmerelo .tell tbrowder they're probably OK. Thanks! 06:32
tellable6 jmerelo, I'll pass your message to tbrowder
jmerelo There are still a few slots free by the end of the period, so if you've got an idea bouncing around in your head, please submit it 06:41
jmerelo Also this is going to be the CFP for the Perl&Raku devroom codimd.opusvl.com/s/y8VhJaTby# Have your say before we publish it, and get your submissions ready! 06:44
frost-lab p6: run 'date' 09:05
camelia Fri Dec 4 10:05:10 CET 2020
xinming Is there a way to debug the multi method dispatch ? 09:40
xinming Now, I have written a script, and I found the multi method is not dispatched correctly. 09:40
notandinus what's the difference between token and rule? 10:12
moon-child rule can have whitespace around it 10:13
notandinus i dont understand, can you give an example? 10:14
oh nvm i found an example 10:16
moon-child basically a token is a single object, the equivalent of a word. This is like a number, a string, special char, &c
and a rule is a way to combine the two
notandinus :m docs.raku.org/language/grammars it was here
i see, makes sense, thanks
moon-child :)
notandinus and can that single object have space in it? 10:17
moon-child only if you explicitly allow it 10:18
patrickb .tell tony-o If there is any think I can help you with wrt. a new ecosystem please do contact me! 10:20
tellable6 patrickb, I'll pass your message to tony-o
notandinus .tell andinus hi 10:23
tellable6 notandinus, I'll pass your message to andinus
notandinus .tell notandinus hi 10:24
tellable6 notandinus, I'll pass that message to your doctor
notandinus hi
oh i see, thanks tellable6
tellable6 notandinus, I'm happy to help!
notandinus going by this: docs.raku.org/language/grammars#Rules 10:32
isn't it the opposite of what raku says?
token is not ignoring the space, rule is ignoring it right?
for token to match the second case we'll have to specify the space, how is it ignoring it then? 10:33
Xliff m: my @a = gather for ^3 { my @a = (0, 1, 2); take |@a.flat }; @a.gist.say 10:51
camelia [(0 1 2) (0 1 2) (0 1 2)]
Xliff Is there a way to make that (0, 1, 2, 0, 1, 2, 0, 1, 2)?
Geth ¦ doc: MorayJ assigned to hythm7 Issue Document the risk involved when using qqx github.com/Raku/doc/issues/3697 10:55
thundergnat m: my @a = gather for ^3 { my @a = (0, 1, 2); .take for @a }; @a.say 11:06
camelia [0 1 2 0 1 2 0 1 2]
Geth ¦ doc: MorayJ self-assigned Slip documentation give example result that doesn't mesh with current rakudo result github.com/Raku/doc/issues/3709
Geth doc/ISSUE-3709: e5be448dc7 | (Moray Jones)++ | doc/Type/Slip.pod6
Fix slip example error
11:49
doc: MorayJ++ created pull request #3724:
Fix slip example error
11:51
Geth ¦ doc: MorayJ self-assigned The whole explanation for the difference between block and closure is LTA github.com/Raku/doc/issues/3670 12:30
ggoebel_ nonandinus: token R { pattern } is the same as regex R { :r pattern }; ...and rule R { pattern }; is the same as regex R { :r :s pattern }; See: docs.raku.org/language/regexes#Nam...ion_syntax 13:36
tokens don't backtrack. rules don't backtrack and treat whitespace as syntactically significant
gfldex lolibloggedalittle: gfldex.wordpress.com/2020/12/04/bu...genstates/ 14:29
SmokeMachine is there any way of making a ./bin script read its version from the META6.json? 15:23
tyil $*PROGRAM.parent(2).add('META6.json').&from-json<version> 15:39
something like this?
ben_m Is there a way to feed/chain into a reduction operator? i.e. instead of `[+] (1..10).map(10 + *)` something like `(1..10).map(10 + *) ==> [+] # does not work` 15:43
I know that .reduce exists, but sometimes that can be less elegant (`.reduce(* * *)` vs `[*]`)
raku-bridge <jesusthefrog> Can't you just call the reduction operator like a function? &[+](1..10).map(10 + *) 16:11
<jesusthefrog> I don't know what the precedence of that will be like (I did not test this) 16:12
ben_m Oh yeah, this works: (1..10).map(10 + *).&prefix:<[*]> 16:28
I think reduce might be clearer there 16:29
SmokeMachine tyil: I was thinking more like we do with %?RESOURCES 16:38
jmerelo Get your talks ready for FOSDEM! news.perlfoundation.org/post/fosde...for-papers 16:59
jmerelo This year is all online, so you can participate from anywhere in the world! 16:59
Geth doc/ISSUE-3670: 000ebc86b4 | (Moray Jones)++ | doc/Language/control.pod6
Removes references to closures in control flow document

  * Focuses document on control flow. Statements execute immediately
  * Why to use block statements that execute immediately
  * Clarify example and language of how blocks that need controlling are created.
17:16
doc/ISSUE-3670: 7fedced1b1 | (Moray Jones)++ | doc/Language/control.pod6
Fixes broken link to /type/Block
Geth doc: e44ee1fb1f | (Jan Krňávek)++ (committed by Juan Julián Merelo Guervós) | doc/Language/haskell-to-p6.pod6
Update haskell-to-p6.pod6

  `reduce` has not named parameter `with`.
In `[+] 0, |@numbers`, `@numbers` must be slipped.
17:22
linkable6 Link: docs.raku.org/language/haskell-to-p6
Geth doc: MorayJ++ created pull request #3725:
Remove closures discussion from control flow document
17:24
Geth advent: wimvanderbauwhede++ created pull request #78:
Split article into two
17:59
Geth advent: 0aef938300 | (Wim Vanderbauwhede)++ (committed using GitHub Web editor) | raku-advent-2020/authors.md
Split article into two

I split the article into two parts and addressed most of the comments from @jj and @nige123 . New gist links are in the file.
18:04
advent: 191b34ad04 | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | raku-advent-2020/authors.md
Merge pull request #78 from wimvanderbauwhede/patch-1

Split article into two
JJAtria[m] jmerelo: I _think_ my WordPress ID is the same as the one on my GitHub account 18:49
jmerelo JJAtria[m]: let me check 18:51
JJAtria[m] I was frankly shocked to find out I even _had_ an account. What was past me thinking... :P 18:54
jmerelo You're good to go
Upload it as a draft, let me give it the final check and schedule it, please.
JJAtria[m] Will do! I should be able to do that after dinner tonight. Thanks! 18:55
ben_m How would I use a regex from a module? Something like `module Foo { our regex bar { \w+ } }`. I tried /<Foo::bar>/ but I get No such method '!cursor_init' for invocant of type 'Foo' 19:08
codesections does anyone here have any thoughts about when it's better style to use `given` vs `when` vs `==> {…}()` to set the topic? 19:19
(I posted a more verbsose version of that question to the subreddit: www.reddit.com/r/rakulang/comments...red_way/?)
cpan-raku New module released to CPAN! Gnome::Glib (0.17.3) by 03MARTIMM 19:33
codesections (False,).&is(True) # This test fails, but 20:13
(False,).&ok # passes
I understand *why* that is, but it just took me more time than it should have to realize what was going on when I made a change to how some tests were worded 20:15
codesections m: sub f($a) { $a // 0 + 1 }; say f(Nil) 20:31
camelia 1
codesections m: sub g(%h) {}; g(Nil) 20:32
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling g(Nil) will never work with declared signature (%h)
at <tmp>:1
------> 3sub g(%h) {}; 7⏏5g(Nil)
codesections is there a way to allow subs that take an Associative to accept Nil? ^^^^ 20:33
JJAtria[m] jmerelo: I've saved the post as a draft... I think. Let me know if you need me to do anything else! 20:41
tellable6 JJAtria[m], I'll pass your message to jmerelo 20:42
tyil a multi sub?
codesections tyil: oh, of course! Thanks 20:48
RaycatWhoDat Hey. Had a question. I only have a cursory knowledge of grammars and how they work in Raku. If I wanted to make something that resembled a compiler, how would I go about that using Raku? I feel like doing something like that is definitely possible but I'm wondering if I'm just being naive... 21:11
tyil RaycatWhoDat: andrewshitov.com/2018/11/06/creati...th-perl-6/ 21:12
RaycatWhoDat I know compilers are hard work but I was thinking of just starting with a simple interpreter and starting to build on it from ther-
oh
how convenient
codesections :D much of the main Raku compiler uses grammars, too 21:13
RaycatWhoDat mmhmm. I would just wonder how adding features would work with it. Like, if I wanted to add something as complex as pattern matching, does Raku make my life easier or harder? 21:14
codesections RaycatWhoDat: also, for examples of interpreters, seeexamples.p6c.dev/categories/interpreters.html 21:15
RaycatWhoDat Although, this whole effort is stemming from someone saying that Raku didn't have anything to offer in terms of compiler/interpreter design? 21:16
.*
codesections (though some of those are a bit old)
I'm not sure I know what they meant by that 21:17
RaycatWhoDat Same. They probably did the same thing people like doing: take a cursory glance at something with no real intention of learning and just wave it away 21:18
They're building a language that looks Haskell-esque with Elm, I think 21:19
JustThisGuy Hi all! I have a couple of questions. I'm trying to do something like this: 23:49
say '"in quotes"' ~~ / '"' <-[ " ]> * '"'/;
evalable6 「"in quotes"」
JustThisGuy From docs.raku.org/language/regexes "Enumerated character classes and ranges"
But, I want more that one type of quote. Something like this, but this doesn't work: 23:50
token attribute_value { <quote> ([$<-quote>]) $<quote> };
token quote { <["']> };
I found this discussion which is also similar, but it didn't seem to go anywhere: github.com/Raku/problem-solving/issues/97. 23:51
Any answers or alternatives are appreciated!