🦋 Welcome to the IRC channel of the core developers of the Raku Programming Language (raku.org #rakulang). This channel is logged for the purpose of history keeping about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Logs available at irclogs.raku.org/raku-dev/live.html | For MoarVM see #moarvm
Set by lizmat on 8 June 2022.
00:00 reportable6 left 00:01 reportable6 joined 00:09 MasterDuke left 00:34 MasterDuke joined 00:36 MasterDuke79 joined 00:38 MasterDuke left 01:57 Xliff joined 03:27 greppable6 left, notable6 left, committable6 left, benchable6 left, shareable6 left, evalable6 left, releasable6 left, coverable6 left, reportable6 left, nativecallable6 left, squashable6 left, statisfiable6 left, bloatable6 left, unicodable6 left, quotable6 left, linkable6 left, sourceable6 left, tellable6 left, bisectable6 left, bloatable6 joined 03:28 quotable6 joined, notable6 joined, benchable6 joined, linkable6 joined, greppable6 joined, releasable6 joined, statisfiable6 joined, squashable6 joined, committable6 joined, evalable6 joined, tellable6 joined 03:29 nativecallable6 joined, shareable6 joined, coverable6 joined 03:30 bisectable6 joined, reportable6 joined, unicodable6 joined, sourceable6 joined 04:49 Xliff left 06:00 reportable6 left 06:02 reportable6 joined 07:06 [TuxCM] joined 07:24 squashable6 left 07:27 squashable6 joined
gfldex lizmat: Did you spend braintime on how RakuAST macros could interact with POD? 08:07
08:26 sena_kun joined
lizmat yes, I've set up things in such a way that RakuDoc nodes can be part of a statementlist 08:35
and as such are RakuAST nodes like any other RakuAST node
10:53 reportable6 left, unicodable6 left, sourceable6 left, statisfiable6 left, squashable6 left, greppable6 left, bloatable6 left, committable6 left, evalable6 left, coverable6 left, notable6 left, releasable6 left, quotable6 left, tellable6 left, bisectable6 left, benchable6 left, linkable6 left, bloatable6 joined, bisectable6 joined, quotable6 joined, coverable6 joined, committable6 joined 10:54 linkable6 joined, statisfiable6 joined 10:55 evalable6 joined, unicodable6 joined, releasable6 joined, notable6 joined, reportable6 joined, sourceable6 joined 10:56 benchable6 joined, greppable6 joined, squashable6 joined, tellable6 joined
lizmat nine vrurg it looks like I hit a snag with doc parsing that could be solved by *always* loading the core.c setting 11:00
wasn't there another reason to want to do that ? 11:01
nine It would be a simplification and we are always going to load that anyway 11:04
lizmat ok, then I will continue on that premise 11:06
it will only block parsing pod only files for now 11:07
as it won't see some methods in the augmented RakuAST::Doc::Block class
yet
BTW, I have given up on making the RakuDoc parsing a slang 11:08
should someone grok slangs in the future, it would be relatively easy to make it one again 11:09
12:00 reportable6 left 12:01 reportable6 joined
lizmat progress! +2 -4 :-) 12:40
12:45 jgaz joined
[TuxCM] Rakudo v2023.04-15-g1f010bd8a (v6.d) on MoarVM 2023.04-1-g965be0af5
csv-ip5xs0.818 - 0.827
csv-ip5xs-205.062 - 5.538
csv-parser3.479 - 3.603
csv-test-xs-200.378 - 0.381
test6.250 - 7.498
test-t1.356 - 1.387
test-t --race0.845 - 0.873
test-t-2020.573 - 21.362
test-t-20 --race6.272 - 6.433
13:22
If I have a named argument to a method «method foo (@kh)», how can I check in the code if it was passed (I expect it to be empty if given) 13:24
vrurg lizmat: don't forget that when it comes to compiling the core itself there will be no setting to load. I mean, the pre-loading code should not be hard to get around. 13:25
tellable6 2023-04-27T01:58:59Z #raku <Xliff> vrurg I was the one behind the initial implementation, but the one that made it into main is nine's.
2023-04-27T01:59:48Z #raku <Xliff> vrurg To my knowledge, the only way to limit the number of jobs is logic left at the application level.
2023-04-27T02:01:37Z #raku <Xliff> vrurg See my parallel compilation runner, here - github.com/Xliff/p6-GtkPlus/blob/m...d.pl6#L124
vrurg [TuxCM]: I use something like `sub foo(*%p) { %p<named>:exists }` 13:26
[TuxCM]: methods has default slurpy %_, but I avoid using it in big code for readability. 13:27
[TuxCM] looks like exactly this: github.com/rakudo/rakudo/issues/2483 13:34
vrurg I use a similar approach sometimes: 'my class NOT-SET {};` or, sometimes, `my class NOT-SET is Nil {}`. 13:37
This is when the value is not supposed to escape its lexical scope. 13:38
[TuxCM] in my current case the method where I want this is a few levels deep, and using what you (and Liz) suggest will cause noise 13:40
vrurg What kind of noise? 13:44
m: sub foo(Int $a = 0 but my role NOT-SET {}) { say ($a ~~ NOT-SET ?? "NOT " !! ""), "PASSED ", $a; } foo; foo(0);
camelia ===SORRY!=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> T-SET ?? "NOT " !! ""), "PASSED ", $a; }⏏ foo; foo(0);
expecting any of:
infix
infix stop…
vrurg m: sub foo(Int $a = 0 but my role NOT-SET {}) { say ($a ~~ NOT-SET ?? "NOT " !! ""), "PASSED ", $a; }; foo; foo(0);
camelia NOT PASSED 0
PASSED 0
[TuxCM] github.com/Tux/CSV/commit/0a7f83f3...45a7cb2aa4 - See line 1576 14:03
Noise meaning I have to do the NOT-SET role stuff on all levels
14:06 m6502 joined, jgaz left
vrurg I don't get what you want to achieve in there. Find out if @kv was passed in? BTW, what if the role has a method is-default? Then you could do $param.?is-default. A little bit costly, but if not used in a hot path then it'd be OK. 14:08
nine Of course the other way to do this is just turn it into two multi candidates, one with that (mandatory) argument, the other without. If you're in the one with argument, you know that it's been provided 14:54
That should give you the highest performing solution
[TuxCM] nine, I thought about that, but with 5 optional parameters, that would be 32 variations 15:36
in this case, I want the default for $out depend on the fact that @kh was actually given as arg 15:37
15:38 nine left, nine joined
[TuxCM] And the NOT-SET role breaks all other signatures down the line, as the type suddenly is Array+{Text::CSV::NOT-SET} instead of Array 16:04
16:30 [TuxCM] left 16:31 [TuxCM] joined
Voldenet > If I have a named argument to a method «method foo (@kh)», how can I check in the code if it was passed (I expect it to be empty if given) 16:42
m: sub foo (:@kh = Empty) { @kh.defined.say }; foo(:kh(^10)); foo()
camelia True
False
Voldenet maybe I'm oversimplifying the question 16:44
lizmat m: my class NOT-SET { }; sub a(:$a = NOT-SET) { say "not set" if $a ~~ NOT-SET }; a(:a(Empty)) 16:47
camelia ( no output )
lizmat basically, use a sentinel value and check for that
m: sub NOT-SET { state $ = Any.new }; sub a(:$a = NOT-SET) { say "not set" if $a<> =:= NOT-SET }; a(:a) 16:51
camelia ( no output ) 16:52
lizmat m: sub NOT-SET { state $ = Any.new }; sub a(:$a = NOT-SET) { say "not set" if $a<> =:= NOT-SET }; a
camelia not set
Geth rakudo/main: 70dc3c8a6b | (Elizabeth Mattijsen)++ | src/core.c/Nil.pm6
Nil.Int should coerce to 0, not to ""
17:18
18:00 reportable6 left 18:02 reportable6 joined 18:17 m6502 left 19:18 tellable6 left, notable6 left, reportable6 left, quotable6 left, linkable6 left, committable6 left, bisectable6 left, releasable6 left, sourceable6 left, unicodable6 left, greppable6 left, bloatable6 left, squashable6 left, coverable6 left, shareable6 left, benchable6 left, evalable6 left, statisfiable6 left, nativecallable6 left 19:19 statisfiable6 joined, unicodable6 joined, notable6 joined, quotable6 joined, evalable6 joined, linkable6 joined
gfldex m: sub foo(|c(:$named)) { dd c.hash<named>:exists; }; foo(:named);foo(); 19:19
19:19 coverable6 joined 19:20 bloatable6 joined
camelia Bool::True
Bool::False
19:20
19:20 benchable6 joined, bisectable6 joined
gfldex [TuxCM]: if you are willing to add a Capture (and thus a subsig), you can reason at runtime about the argument list. 19:20
19:20 releasable6 joined 19:21 tellable6 joined, nativecallable6 joined, shareable6 joined, sourceable6 joined, reportable6 joined, squashable6 joined, committable6 joined 19:22 greppable6 joined
Geth rakudo/main: 14fed334ed | (Stefan Seifert)++ | src/Raku/ast/signature.rakumod
RakuAST: fix bound parameters being writable all the time

Makes my :($a) := \(3); $a++; die as it should.
19:22
vrurg [Tux]: It's a good advise from gfldex too, though might be somewhat slowish for an often times called routine. Yet, I don't see how an Array+{Role} type can break with other signatures? It's still is an Array, a Positional. 20:05
20:22 linkable6 left, evalable6 left 20:24 evalable6 joined 20:25 linkable6 joined 20:49 squashable6 left, squashable6 joined 21:15 sena_kun left 22:15 evalable6 left, linkable6 left, shareable6 left, reportable6 left, releasable6 left, squashable6 left, statisfiable6 left, coverable6 left, nativecallable6 left, benchable6 left, quotable6 left, tellable6 left, sourceable6 left, bisectable6 left, unicodable6 left, committable6 left, notable6 left, bloatable6 left, greppable6 left 22:16 tellable6 joined, notable6 joined, bloatable6 joined, shareable6 joined, coverable6 joined, reportable6 joined, linkable6 joined, evalable6 joined, statisfiable6 joined 22:17 unicodable6 joined, bisectable6 joined, squashable6 joined, sourceable6 joined, greppable6 joined, releasable6 joined, quotable6 joined 22:18 nativecallable6 joined, benchable6 joined, committable6 joined 23:30 codesections left 23:43 codesections joined 23:49 codesections left