🦋 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:02 MilkmanDan left 00:28 guifa2 joined 00:32 dogbert11 joined 00:33 tejr left, zacts joined 00:35 dogbert17 left 00:40 tejr joined 00:53 stanrifkin left 01:01 _jrjsmrtn joined 01:02 __jrjsmrtn__ left 01:04 gdonald left 01:11 dogbert17 joined 01:14 dogbert11 left 01:15 sena_kun joined 01:16 Altai-man left 01:36 zacts left 01:37 zacts joined 01:45 Noisytoot left 01:53 zacts left, dogbert11 joined 01:57 dogbert17 left
codesections .tell melezhik `[…]` is the Array constructor. `(1,2)` constructs a list; `%(1, 2)` constructs a Hash; and `[1, 2]` constructs an Array. That means `[ [1,2], ]` - which is the same as `[ [1,2], () ]` constructs an Array inside an Array. Thus, `[ [1,2], ][0]` is `[1,2]`. But, without the trailing `,`, empty layers are ignored, so `[ [1,2] ][0]` is `1`. Does that help? 02:00
tellable6 codesections, I'll pass your message to melezhik
02:02 melezhik joined
melezhik . tell timotimo: looks like I have found that ideally fits my use case docs.raku.org/language/list#Single...ment_Rule. 02:03
tellable6 hey melezhik, you have a message: gist.github.com/ebf3329a42973a725d...1655c19ce5
melezhik 😊 02:04
02:05 melezhik left, Manifest0 left 02:06 Manifest0 joined, melezhik joined 02:08 dogbert17 joined
melezhik codesections: yeah I am slowly figuring all this out while reading documentation. but yeah thanks to you and timotimo: for all the help. 02:08
rypervenche codesections: Would you say that [] is the same as @(), or does @() coerce something to an array? 02:09
02:11 dogbert11 left
codesections The other way around, I'm pretty sure - `[]` coerces to an Array, but @() just makes it Positional (which could be a list) 02:11
02:11 melezhik left, dogbert11 joined
codesections m: say @(1,2).WHAT; say [1,2].WHAT 02:11
camelia (List)
(Array)
rypervenche Oooh 02:12
TIL :P
02:14 dogbert17 left 02:21 dogbert17 joined 02:23 dogbert11 left 02:30 guifa2 left 02:41 dogbert17 left 02:44 dogbert17 joined 02:53 skids left, cooper joined 03:14 melezhik joined
melezhik as for `[1],` I am also reading this - perl6advent.wordpress.com/2015/12/...-refactor/ 03:14
03:25 zacts joined 03:32 lucasb left
melezhik .tell timotimo hopefully now I nailed it down - github.com/melezhik/Sparrow6/blob/...args-array 03:47
tellable6 melezhik, I'll pass your message to timotimo
03:49 melezhik left 03:50 guifa2 joined
guifa2 m: class Foo is Date { method new(*%c) { self.bless(|%c) } }; say Foo.new(:2020year, :15month, :56day) 03:52
camelia 2020-15-56
guifa2 :D :D :D :D
guifa2 gives extra evil grin
04:01 cpan-raku left 04:02 cpan-raku joined, cpan-raku left, cpan-raku joined 04:14 clarjon1 joined 04:26 zacts left 05:03 cooper left 05:14 Altai-man joined 05:16 ensamvarg3 joined, sena_kun left 05:47 yuplushi left 05:56 wamba joined 06:11 rindolf joined 06:28 zacts joined 06:30 yuplushi joined 06:48 xinming_ left 06:50 xinming_ joined 07:12 zacts_ joined 07:16 zacts left, zacts joined 07:17 JJMerelo joined
JJMerelo releasable6: status 07:17
releasable6 JJMerelo, Next release in ≈6 days and ≈11 hours. 1 blocker. Changelog for this release was not started yet
JJMerelo, Details: gist.github.com/8609f4122ffd87867b...40e3781a04
07:17 zacts_ left 07:25 keutoi joined 07:43 dolmen joined 07:49 dolmen left 08:17 ensamvarg3 left
Geth advent: 4f707ec0ac | (JJ Merelo)++ | 20th/articles/rfc159.md
Minor typographic corrections
08:24
08:26 ensamvarg3 joined 08:43 leont joined 08:51 keutoi left 08:52 sena_kun joined 08:53 Altai-man left 09:01 JJMerelo left 09:02 samcv left, samcv joined 09:07 MilkmanDan joined 09:32 JJMerelo joined 09:38 keutoi joined 09:43 keutoi left 09:49 ensamvarg3 left 10:02 wamba left 10:06 pecastro joined 10:10 fridim left 10:12 fridim joined, stoned75 left 10:14 stoned75 joined 10:18 wamba joined 10:27 bdju left 10:28 bdju joined 10:34 JJMerelo left 10:37 Sgeo left
Geth ecosystem: 71548649ae | (Ramiro Encinas)++ (committed using GitHub Web editor) | META.list
Added System::Stats::CPUsage module
10:50
10:54 ramix joined 11:00 ramix left 11:59 molaf joined 12:16 zacts left 12:31 keutoi joined 12:51 Altai-man joined 12:53 sena_kun left 12:59 cpage left 13:10 keutoi left, zacts joined 13:16 keutoi joined 13:27 keutoi left 13:34 lucasb joined 13:38 keutoi joined 14:06 mirrorbird joined 14:20 MilkmanDan left 14:21 MilkmanDan joined 14:44 stoned75 left
holyghost I managed a good parsing system for my theorem prover 14:46
It uses operators (and,not,or) on lists
I might port it to nqp with a patch for the delimiter theorem prover, for raku 14:47
as a patch, nothing much
people don't need it :-)
it's somewhat better in scheme as it is now, as you need an index for a nqp list 14:48
14:48 mirrorbird left 14:50 stoned75 joined 14:51 keutoi left 14:54 xinming joined 14:57 xinming_ left 15:26 orinthe left 15:27 orinthe joined 15:28 MilkmanDan left 15:31 MilkmanDan joined 15:36 squashable6 left 15:38 squashable6 joined 15:48 JJMerelo joined
JJMerelo Hey 15:48
lizmat JJMerelo o/ 15:52
JJMerelo \o
lizmat the hacker news post has had a big impact on visits. 15:53
lizmat as well as reference spam
lizmat which one are you talking about?
I post regularly on HN :-) 15:54
JJMerelo lizmat the one about OO and RFC 15:57
raku-advent.blog/2020/08/16/rfc-18...d-methods/ 15:58
There must have been something special about it, since it's quadrupled visits just by being mentioned there.
lizmat yeah, Damian again serving as clickbait on HN :-) 15:59
JJMerelo So that's the thing... 16:04
lizmat it only works sometimes, oddly enough 16:05
didn't work for raku-advent.blog/2020/08/13/rfc22-...an-conway/ :-( 16:06
JJMerelo Let's hope there's some spillover to the other stories... 16:07
lizmat looking up to add docs for Proc::Async::Pipe, but also stopping at Proc::Async 16:12
lizmat what does this mean? github.com/rakudo/rakudo/blob/ed93...c.pm6#L124
It means that it needs to be deprecated, but it's not?
16:12 rockxloose left 16:13 rockxloose joined, MilkmanDan left
lizmat Zoffix appears to have added that line... I guess it was part of the IO grant that they gave back later 16:14
I have no idea
16:15 MilkmanDan joined, stoned75 left
JJMerelo Proc::Async seems to have shifted away from docs, also. 16:16
lizmat isn't Patrick Böker working on that ? 16:17
JJMerelo The docs? Not AFAIK
lizmat no, on Proc::Async? 16:18
JJMerelo Ah, OK, yes, that part was added by him. 16:19
lizmat but then again the docs do not seem to correspond to the actual definition of Proc::Async.new 16:20
lizmat perhaps check with PB ? 16:21
JJMerelo lizmat github.com/rakudo/rakudo/blob/ed93...c.pm6#L123
vs docs.raku.org/type/Proc::Async#method_new
lizmat looks like all extra named args are passed on verbatim ? 16:23
16:23 jessa^22 joined
JJMerelo Ah, OK, the |%_ part 16:23
lizmat JJMerelo: you still need my #200 post, right ? 16:24
JJMerelo lizmat yes, please, for tomorrow if possible.
If you can't make it I'll try to whip up something.
lizmat ok, I will work on that now then and have it ready before I start working on tomorrow's RWN
JJMerelo thanks, lizmat
lizmat I can make it... just wanted to know for sure if nobody else filled the remaining slots 16:25
JJMerelo I got [Coke]'s, keeping it for last.
16:27 MilkmanDan left, skids joined 16:33 jessa^22 left 16:35 guifa2 left 16:36 guifa2 joined
Geth doc: e8c5aca937 | (Elizabeth Mattijsen)++ | 3 files
Correct name of named argument to STORE

It has been INITIALIZE for quite some time already.
16:41
16:46 zacts left 16:51 sena_kun joined 16:54 Altai-man left
lizmat hates false positives from CI runs 16:57
app.circleci.com/pipelines/github/...a/jobs/814
Geth doc/master: 6 commits pushed by (JJ Merelo)++ 17:00
JJMerelo lizmat I think I'm going to disable that. It never works...
lizmat if people see too many false positives, they will ignore the reports
I know I will
17:21 guifa2 left
leont I can't get rakudo to build anymore, becuase 3rdparty/nqp-configure trips over with «error: Entry '3rdparty/nqp-configure/README.md' not uptodate. Cannot merge.» 17:23
Anyone have a clue? Other than «rm -rf && git clone» 17:24
lizmat git stash ?
leont The submodule is in a clean state
lizmat git submodule update ? 17:27
leont Doesn't seem to make a difference 17:37
paste.scsys.co.uk/592443 17:38
lizmat have you tried without the --backends=moar ? 17:39
leont Same result 17:40
17:40 Sgeo joined
lizmat rename the install dir to something else, mimicking its absence ? 17:41
builds ok for me :-( 17:43
17:49 JJMerelo left
codesections There's not a faster/better way to set the topic var of a sub to parameter than VVVVV, is there? 17:56
sub f($arg) { given $arg { .say }}
:m sub f($arg) { given $arg { .say }}; f 'using given' 17:57
m: sub f($arg) { given $arg { .say }}; f 'using given'
camelia using given
tobs m: sub f ($_) { .say }; f 'using aliasing'
camelia using aliasing
codesections Oh, that's much cleaner – thanks, tobs 17:58
17:58 Sgeo left
tobs you will also see this used with $/ in action classes of grammars 17:58
codesections You know, I *have* seen that -- it should have occured to me that I could do the same thing with $_ as with $/
lizmat codesections: if you just want a code block that says what it gets, then &say would do what you want 17:59
codesections tobs, is there a way to use that syntax with a named parameter?
leont Creating an entirely new checkout "solved it", may need to move some branches over though 18:00
18:01 Sgeo joined
tobs codesections: yeah, I think that's called aliasing as well 18:01
m: sub f(:named($_)) { .say }; f named => 'test'
camelia test
codesections Thanks, lizmat. I was asking more generally about the syntax for assigning the topic variable when declaring a sub, so tobs' answer was what I was looking for. (I find myself using blocks for a similar purpose (`my &f { *something with the topic* }` instead of (`sub f($name) {…}`), but this approach seems clearer) 18:02
lizmat codesections: you're welcome
codesections Thanks. Here, again, I'd seen (and even used!) aliasing syntax. But I hadn't put the pieces together! 18:03
18:10 MilkmanDan joined
tobs yes, raku gives you that feeling every now and then. It's great :) 18:11
lizmat note that this behaviour is also handy in TWEAK 18:22
m: class Foo { has $!a; method TWEAK(:$!a = 42) { }; method a() { $!a } }; dd Foo.new.a 18:23
camelia 42
codesections m: class Foo { has $!a; method TWEAK($!a = 42) { }; method a() { $!a } }; dd Foo.new.a 18:26
camelia 42
codesections lizmat: Very interesting, thanks. What role is the `:` playing? It looks like the same result without it? 18:27
lizmat without the :, it is a positional parameter 18:28
and since it has a default, and no value was specified, it seems to work
m: m: class Foo { has $!a; method TWEAK($!a = 42) { }; method a() { $!a } }; dd Foo.new(a => 666).a # but in fact does not
camelia 42
18:29 Maylay left
codesections aha, thanks. Very useful stuff :) 18:29
18:31 Maylay joined 18:32 Celelibi joined
codesections Is there a straightforward way to check whether a string constitutes a syntactically valid Regex? I've encountered that issue when working with text interpolated into a regex (see below) 19:05
m: my $a := '.'; say 'foo' ~~ /<$a>/; # this works
camelia 「f」
codesections m: my $a := '*'; say 'foo' ~~ /<$a>/; #this doesn't
camelia 5===SORRY!5=== Error while compiling /home/camelia/EVAL_0
Quantifier quantifies nothing
at /home/camelia/EVAL_0:1
------> 3anon regex { *7⏏5}
codesections Is there a way to check for ^^^ before running the Regex (ideally, even to prevent a string that would be an invalid Regex from matching the Signature), or is it better to just catch the error when it happens? 19:06
lizmat using a CATCH block or a try would be my suggestion 19:08
codesections Thanks. That was my thought too, but I wanted to make sure there wasn't some Signature trickery I didn't know about :) (Something like sub `f(Regex(Str) $a)`, but that doesn't quite work) 19:09
lizmat that will only do type checking 19:12
codesections m: sub f(Int(Str) $a) { say $a}; f('42'); f('foo') 19:14
camelia 42
Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo' (indicated by ⏏)
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
codesections that ^^^ asks for a Str that can be validly coerced to an Int. I was wondering if there was something similar for a Str that can become a Regex 19:15
But it makes sense that there isn't – a Str isn't *coerced* to a Regex, it's *interpolated* as (part of all) of one 19:16
19:19 lichtkind joined
Geth advent: 5890941ec9 | Altai-man++ (committed using GitHub Web editor) | 20th/README.md
Promise RFC 84
19:22
19:32 sena_kun left, sena_kun joined
rypervenche How would change the locale for the .lc method? For example using the Turkish locale and having 'I'.lc.say output 「ı」 instead of 「i」? Changing the locale on my system didn't seem to do anything. 20:29
Geth ecosystem: kjkuan++ created pull request #524:
Add my Shell::DSL module to the list
20:39
MasterDuke hm. do you have it available on your system? `locale -a` for me only lists 'C', 'en_US.utf8', and 'POSIX' 20:42
rypervenche MasterDuke: I do indeed. 20:45
export LANG="tr_TR.UTF-8" LC_ALL="tr_TR.UTF-8" LANGUAGE="tr_TR"; raku -e "say 'I'.lc;"
MasterDuke hm, not sure then (as you can probably tell, i don't do much with locales) 20:47
20:51 Altai-man joined 20:53 sena_kun left
moritz rakudo doesn't do any locales, afaict 20:55
codesections Hmm, I have a POST block, and when I return a value from the function with the `return` keyword, it works fine. But when I return *the same value* with the implicit return in a `when` block, it dies and says 'expected Any but got Mu (Mu)'. How odd 20:59
m: sub f() { POST { .say; True }; when ?True { return 5 }; 6}; f 21:04
camelia 5
codesections sub f() { POST { .say; True }; when ?True { 5 }; 6}; f
m: sub f() { POST { .say; True }; when ?True { 5 }; 6}; f 21:05
camelia (Mu)
return_value + exit_handler case NYI
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
Geth advent: 407e389fd1 | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | 20th/articles/rfc200.md
Create rfc200.md
codesections ^^^ Slightly different (better?) error msg, but the same general issue. I wouldn't have expected implicit and explicit returns to behave any differently 21:06
lizmat comments welcome ^^
21:06 Sgeo left
lizmat .tell JJMerelo github.com/Raku/advent/blob/master.../rfc200.md 21:06
tellable6 lizmat, I'll pass your message to JJMerelo
21:11 rindolf left 21:18 Sgeo joined 21:20 HarmtH joined 21:26 Black_Ribbon joined 22:02 mowcat joined 22:39 seanrobert joined 23:09 seanrobert left, seanrobert joined 23:19 tejr left 23:20 pecastro left 23:24 lucasb left 23:25 tejr joined, lichtkind left 23:38 cpan-raku left 23:39 cpan-raku joined, cpan-raku left, cpan-raku joined 23:40 leont left 23:50 wamba left