🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
00:01 guifa left 00:07 reportable6 left, guifa joined 00:08 reportable6 joined 00:46 bloatable6 joined, releasable6 joined 00:47 bisectable6 joined, coverable6 joined, linkable6 joined 00:48 committable6 joined, shareable6 joined 01:25 vrurg_ joined 01:27 vrurg left 01:33 lichtkind__ left 01:42 swaggboi left 01:44 frost joined 01:45 ugexe left 01:46 tellable6 joined 02:06 monkey_ joined 02:08 ugexe joined 02:10 ugexe left 02:11 ugexe joined 02:46 greppable6 joined 03:04 ggoebel left 03:07 Xliff_ left 03:30 monkey_ left 03:47 statisfiable6 joined, benchable6 joined 04:47 evalable6 left, linkable6 left 04:58 Xliff_ joined 06:04 releasable6 left, benchable6 left, greppable6 left, statisfiable6 left, shareable6 left, bloatable6 left, unicodable6 left, reportable6 left, notable6 left, nativecallable6 left, coverable6 left, committable6 left, sourceable6 left, squashable6 left, bisectable6 left, quotable6 left 06:05 guifa left, bloatable6 joined, committable6 joined, benchable6 joined, squashable6 joined, nativecallable6 joined 06:06 sourceable6 joined, bisectable6 joined, reportable6 joined, quotable6 joined, coverable6 joined 06:07 shareable6 joined, notable6 joined, releasable6 joined
Geth doc: 1e216133f1 | (Christian Bartolomäus)++ | doc/Language/nativecall.pod6
Minor cleanup for section "Getting started"
06:44
elcaro I'm getting `No such method 'with-export' for invocant of type 'CompUnit::Handle+{<anon|1>}'` when I `use SomeModule:from<Perl5>` after `use v6.e.PREVIEW` 06:51
I couldn't find an existing issue... before I bug it... can someone confirm it's not just me
07:01 djerius left 07:03 djerius joined 07:05 statisfiable6 joined 07:08 unicodable6 joined 07:21 seednode left 07:22 seednode joined 07:49 evalable6 joined 07:53 abraxxa joined
MasterDuke elcaro: same here 07:56
07:58 abraxxa left 07:59 abraxxa joined 08:44 Sgeo left 09:06 greppable6 joined 09:17 frost left 09:18 frost joined
Geth ecosystem: 83705f8b22 | (Elizabeth Mattijsen)++ | META.list
It appears that github.com/palapitta has disappeared

This affects the Aria, Bencode, Movieinfo and Weather distributions.
The latest available versions of these modules *are* available in the Raku Ecosystem Archive at github.com/lizmat/REA/
  - Aria blob/main/archive/A/Aria/Aria:ver<0.1.4>:auth<github:palapitta>.tar.gz
  - Bencode blob/main/archive/B/Bencode/Bencode:ver<0.1.1>:auth<github:palapitta>.tar.gz
  - Movieinfo blob/main/archive/M/Movieinfo/Movieinfo:ver<0.1.2>:auth<github:palapitta>.tar.gz
  - Weather blob/main/archive/W/Weather/Weather:ver<0.2.1>:auth<github:palapitta>.tar.gz
09:49
09:49 linkable6 joined 10:00 lichtkind__ joined
lizmat I guess we could consider moving these modules to raku-community-modules 10:07
well, re-instating would be a better word, I guess
frost Just out of curiosity, in raku, the C style loop `loop (my $i = 0; $i < 10; $i++)`, why is $l outside the scope here 10:18
moon-child context? 10:20
what is $l?
10:22 p6steve left 10:24 p6steve joined
lizmat frost generally people expect the counter to be available *after* a C-style loop ? 10:37
otherwise you would just use for ^10 -> $i { } 10:38
moon-child oh, I see. I definitely find that behaviour surprising
in c: for (int i = 0; i < 10; i++); //i is no longer in scope
if you want it to remain in scope, then declare it externally, as in int i; for (i = 0; i < 10; i++); //i remains in scope 10:39
However it is somewhat consistent, given you can say e.g. '3 + (my $x = 2)' and $x will be visible outside 10:40
10:51 p6steve left 10:52 p6steve joined
frost sorry, J=just dealt with something 11:09
yeah, moon-child, it is different from C 11:10
holyghost e.g. my $I = 0; BTW (undef) 11:13
I didn't drink for 2 days, so it's going better for me (doctor's orders), I don't know if I want to take vacation 11:15
Just saying for old time's sake
11:16 stoned75 joined
frost lizmat: I see, but for me, I am more familiar with C. 11:26
lizmat well, I guess that's a behaviour inherited from Perl then 11:27
frost In C, I can use the same loop statement `for (int i = 0; i < 10; i++)` many time in the same  scope
In raku, if i use the C style loop, i have to define differet counter 11:28
lizmat in Raku, idiomatically you'd use: for ^10 -> int \i { }
frost yeah, it's so nice
i ask this just for curiosity
lizmat thanks 11:29
11:29 p6steve left
moon-child I don't really know perl, but in a basic test it does not seem to behave that way eitehr 11:29
either
lizmat frost: sure, but the "bleeding into outer scope" is the reason we have a "loop" in Raku, afaik
well, then I'd say @LARRY changed their mind on that :-) 11:30
frost wow
interesting ;)
lizmat but really, the C-style loop exists in Raku *because* of the bleeding of the counter
I can't really see another really valid reason for it 11:31
11:34 Altai-man joined 11:36 Xliff_ left 11:38 p6steve joined
stoned75 hi 11:42
frost stoned75 hello 11:44
stoned75 I was looking after documenting IO::Path.add(@list), cf. github.com/rakudo/rakudo/pull/4472, then I was wondering about what is planned for IO::Path.child(), which right now is documented as "alias for .add", when it is not anymore ':) 11:47
and considering github.com/rakudo/rakudo/commit/8b...ca565646e7
Voldenet compare HEAD my $n = 0; for ^10 -> \i { $n += i }; ||| my $n = 0; for ^10 -> $i { $n += $i }
lizmat stoned75: I'm not touching that anymore 11:48
Voldenet benchable6: compare HEAD my $n = 0; for ^10 -> \i { $n += i }; ||| my $n = 0; for ^10 -> $i { $n += $i }
benchable6 Voldenet, starting to benchmark the 1 given commit
stoned75 arf ':)
benchable6 Voldenet, gist.github.com/4a59f84f2d529c858e...9c5ac64547
Voldenet \i seems significantly slower than $i in this context 11:50
12:04 squashable6 left 12:06 squashable6 joined
holyghost for (my $i = 0; $i < 1024; $i++) {} 12:06
lizmat Voldenet: that's because the standard way of `for Range` is highly statically optimised 12:07
12:08 reportable6 left
Voldenet Oh, so it isn't the case for every iterable 12:09
12:10 reportable6 joined
holyghost scsi, loop (my $i = 0; $i < 1024; $i ++) {} 12:19
12:38 ggoebel joined 13:20 monkey_ joined 13:24 monkey_ left 13:25 getimiskon joined 13:27 monkey_ joined 13:31 [Coke] left 13:34 [Coke] joined 13:35 getimiskon left 13:55 getimiskon joined 13:59 guifa joined 14:10 lichtkind__ left 14:11 frost left 14:23 Guest26 joined, Guest26 left 14:37 monkey_ left 14:46 jgaz joined 14:47 ggoebel left 14:57 getimiskon left 15:06 euandreh left 15:17 getimiskon joined 15:27 Sgeo joined 15:32 monkey_ joined 15:48 monkey_ left 15:50 monkey_ joined 16:01 monkey_ left 16:07 euandreh joined 16:15 ggoebel joined 16:21 jgaz left
thowe Hi Raku folks. How are you today? 17:10
tonyo lizmat: did you checkout the fez orgs stuff? 17:11
lizmat tonyo: didn't get around to it yet... almost ready with the Weekly, then one more advent post to finish before tomorrow... 17:12
too many things to do, not enough time :-( 17:13
17:21 evalable6 left, linkable6 left
thowe I love the advent calendar; I appreciate what goes into it. 17:24
17:30 dg left
guifa lizmat: I'm almost done recoding timezones. Pulled out the data/calculations, but still finishing up the last bit of C code conversion 17:31
they made a lot of changes since i last ported it
17:36 jgaz joined 18:07 reportable6 left 18:09 reportable6 joined 18:15 Altai-man left 18:21 linkable6 joined 18:30 djerius left
tonyo .notable deathbykeystroke.com/articles/2021...racle.html 18:31
18:31 djerius joined
lizmat tonyo: talk about JIT publishing :-() 18:31
tonyo weekly: deathbykeystroke.com/articles/2021...racle.html
notable6 tonyo, Noted! (weekly)
lizmat :-)) rather
notable6: weekly reset
notable6 lizmat, Moved existing notes to “weekly_2021-12-20T18:31:56Z”
tonyo haha
hard to keep track of the bots 18:32
JJ asked me to do a `how to get started with fez` for the advent
lizmat so, do you want me to import that into the Advent Calendar? 18:33
tonyo i think tomorrow i'll write up a quick tut, may have to download mi6 and figure that out
lizmat ok, gotcha
tonyo the org one? nah, i'll just link it from the one i'm going to write tonight or tomorrow
lizmat ok
[Coke] raku -MFile::Temp -e1; # is there a way to do this that doesn't complain about sink? 18:35
lizmat -e'' 18:36
[Coke] -e'' gives help usage.
-eNil works.
lizmat -e '' 18:37
note the whitespace
[Coke] lizmat++
[Coke] uses File::Temp for something, duff++ 18:38
guifa I find it so weird that it's quite difficult to make natives constants 18:42
18:43 mcmillhj joined
lizmat guifa: I don't think you can atm 18:43
the problem is that a native is a piece of memory that is not an object by itself
guifa lizmat: my work around is to put them into a module called "Constants"
and then
lizmat and pre-compilation needs objects, and constant are compile time construcrts 18:44
guifa sub EXPORT { my int $FOO = 0; Map: :$FOO }
lizmat that would not make $FOO a constant: assigning to it would work
guifa Right
It's not a true constant 18:45
lizmat why do you need it to be a native ?
guifa but where I 'use Constants'; the term "FOO" would appear, sans sigils
lizmat: porting C code that is designed with wrapping in mind.
mcmillhj Can someone explain the semantics of what is happening with `$depth` here? I kind of expected the _value_ of `$depth` to be copied into my array, not a reference. 18:47
topaz.github.io/paste/#XQAAAQCjAQA...r6HGP8BnUA
guifa as much as I'd love to rewrite the code to be super Raku-ish, I had to rewrite stuff from scratch (in a very C-accented Raku) because it's nigh impossible to track the changes in the C code in my Rakuish version =\
mcmillhj: I believe it's because you've used push: (List) 18:49
@snailfish.append: $c.Int, $depth;
that gives me [4, 4, 3, 4, 4, 3, 4, 2, 7, 2, 8, 4, 4, 4, 9, 3, 1, 2, 1, 2] as a result
mcmillhj I actually want it to be a subarray, `push: [$c.Int, $depth]` appears to work. That is just confusing to me for some reason. 18:50
guifa ah, you want to keep them in the subaray. push: (+$c, +$depth) seems to work. 18:52
but the list doesn't copy values or anything 18:53
m: my $a = 0; my @b is List = $a, $a, $a; $a++; say @b;
camelia (1 1 1)
guifa m: my $a = 0; my @b is Array = $a, $a, $a; $a++; say @b;
camelia [0 0 0]
18:57 vodkra left 18:58 vodkra joined
mcmillhj thanks guifa 18:58
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/12/20/2021-...ransiting/ 18:59
guifa lizmat++
19:00 vodkra left, vodkra joined
thowe In the code at gist.github.com/bduggan/a929bd7a06...55dcb7b316 on lines 9 and 10, what does the *.f and *.d mean? Are those globs of file names (seems not) or do those have special meaning to multi or IO::Path ? 19:11
or am I trying to bite off too much at once? there's a lot going on there I don't quite get. 19:15
guifa thowe: the * is a Whatever 19:19
in this case, it refers to $f
19:20 atroxaper joined
thowe OK, but what is it doing? how do *.f and *.d differ? What are those? How does it know which version of the function to run? 19:20
guifa files(IO::Path $f where *.d) === subroutine "files" with a first argument of type IO::Path named $f, where it (* or $f) is a directory (.d)
atroxaper Hello, #raku 19:21
guifa $file.d = is $file a directory? $file.f = is $file a file ?
holyghost takes a few days of vacation 19:22
guifa m: multi sub size (Int $a where $a < 10) { say "small" }; multi sub size (Int $a where * ≥ 10) { say "big" }; size 5; size 15; size 1; 19:23
camelia small
big
small
guifa that might make it a bit clearer what's going on
19:32 tejr left 19:33 tejr joined
thowe OK, so those are something specific to IO::Path then? Just trying to figure out where to look at docs to understand them. 19:35
Ah I see, method f and method d... 19:37
wild 19:39
guifa yup, exactly. You wouldn't be able to use .d/.f on most other things 19:44
holyghost Here's the best I wrote in 5 years chosen by my admin, I put it online here : sf.net/projects/bubblesrc. The user login features later projects 19:50
5 years, 5 years ago :-)
We posted links back in the day at WF, so there you go
19:52 daxim left 20:01 seednode left, seednode joined 20:05 daxim joined
thowe guifa++ 20:08
20:20 patrickb joined, atroxaper left 20:21 evalable6 joined 20:33 japhb left 20:44 Guest70 joined 20:45 Guest70 left, Guest70 joined, Guest70 left 20:46 daxim left 20:54 eseyman left 20:59 eseyman joined 21:09 MasterDuke left 21:10 daxim joined 21:16 daxim left, abraxxa left 21:21 MasterDuke joined, jgaz left, Zero_Dogg left
lizmat tonyo: so "fez org list" shows up empty, which means I would have to create an org from scratch, right ? 21:22
tonyo yea lizmat 21:30
lizmat any limitations as to the org name ? 21:31
tonyo as long as there is no user or group with that name existing 21:32
lizmat ok 21:34
tonyo should I get a mail after creating an org? 21:38
tonyo nope, just on invites
21:39 mcmillhj left
lizmat and I guess the auth of a module should then be zef:org-name right ? 21:39
tonyo yea
lizmat ok, lemme take one then as a test case :-) 21:40
21:40 daxim joined 21:46 dg joined
tonyo which one you uploading? 21:49
lizmat well, I am looking at Die
simple, straightforward :-)
22:04 Zero_Dogg joined
lizmat tonyo: hmmm.. it appears that mi6 will need some tweaking before this gets straigtforward 22:06
yeah, will need some work on App::Mi6 22:14
auth 'zef:raku-community-modules' in META6.json does not match auth 'zef:lizmat' in ~/.fez-config.json 22:15
22:26 guifa left 22:46 patrickb left
lizmat tonyo: Die:auth<zef:community-modules> should now be a thing 22:53
tonyo: Die:auth<zef:raku-community-modules> 22:54
rather
Xliff I'm trying to put a custom trait on a class definition. Which trait mod can I use for that?
trait_mod:<is> will not work for classes, since it is used for inheritance.
lizmat sub trait_mod:<is> probably?
make sure the name of the trait is a *required* named argument 22:55
sub trait_mod:<is>(Any:U $class, :$foo!) { dd }; class A is foo { }
m: sub trait_mod:<is>(Any:U $class, :$foo!) { dd }; class A is foo { }
camelia ===SORRY!=== Error while compiling <tmp>
Type check failed in binding to parameter '$class'; expected Any but got A (A)
at <tmp>:1
lizmat m: sub trait_mod:<is>(Mu:U $class, :$foo!) { dd }; class A is foo { } 22:56
camelia sub trait_mod:<is>(Mu:U $class, :$foo!)
lizmat Xliff ^
Xliff Ooh! Let me try. 22:57
And I take it roles cannot be punned on to type objects? 23:00
gfldex m: multi sub trait_mod:<is>(Mu:U $c, :$foo) { say $c.^mro; }; class C is Any is foo<42> { }
camelia ((C) (Any) (Mu))
gfldex Looky like you need to add Any by hand in this case. 23:01
23:10 getimiskon left 23:11 daxim left 23:12 daxim joined
Xliff Hum... 23:33
m: use NativeCall; class A is repr<CStruct> { has uint32 $.a }; A.REPR.say
camelia CStruct
Xliff m: use NativeCall; class A is repr<CStruct> { has uint32 $.a }; A.REPR.say; ::("A").REPR.say
camelia CStruct
CStruct
tonyo lizmat: looks good 23:36
the first RCM module in fez
Xliff Hum. 23:37
I think we haz problem.
If i use a module with a struct, I get the right .REPR value
However if I late-load AND late-bind, said .REPR is now P6opaque
./p6gtkexec -e 'require ::("GDA::Raw::Structs"); ::("GdaTimestamp").REPR.say' # P6opaque 23:38
23:38 djerius left
Xliff ./p6gtkexec -e 'use GDA::Raw::Structs; GdaTimestamp.REPR.say' # CStruct 23:38
lizmat Xliff: is repr() needs to be done on the very first mention of a class, even if it is a stub
that's a known issue afaik 23:39
Xliff lizmat: This did not happen prior to new-disp.
Even late bound references returned the right REPR
23:39 djerius joined
Xliff And this is not about "is repr" on first mention. I know this. 23:39
lizmat hmmm... well, then please make an issue and make sure jnthn is pinged on it
Xliff This is about retrieving the REPR at run-time 23:40
lizmat: OK. Will do.
Geth ecosystem: fe27c24133 | (Elizabeth Mattijsen)++ | META.list
Die now lives in the zef ecosystem
23:42
23:48 xinming left