🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
00:00 reportable6 left, reportable6 joined 00:47 jpn joined 00:51 jpn left 00:54 andydude joined 01:00 Guest88 left 01:04 xinming left 01:06 xinming joined 01:15 ProperNoun left 01:49 derpydoo left
vrurg ugexe: The problem is that as long as I remember, $*DISTRIBUTION is precompiled anyway. Isn't it? 02:06
02:19 teatwo joined 02:22 tea3po left 02:35 jpn joined 02:40 jpn left
ugexe I dunno if all the meta information is precompiled though 02:41
it might be only the version, api, auth, and name keys are precompiled
02:41 andydude left
ugexe so if you called .meta<anything else> it would have to read the META6.json file 02:41
02:45 derpydoo joined 02:50 xinming left 02:56 andydude joined 03:03 xinming joined 04:03 unicodable6 left, squashable6 left, linkable6 left, shareable6 left, releasable6 left, bloatable6 left, evalable6 left, tellable6 left, quotable6 left, statisfiable6 left, benchable6 left, nativecallable6 left, coverable6 left, committable6 left, reportable6 left, greppable6 left, bisectable6 left, notable6 left, sourceable6 left 04:04 benchable6 joined, tellable6 joined, linkable6 joined, greppable6 joined, squashable6 joined, unicodable6 joined 04:05 evalable6 joined, reportable6 joined, releasable6 joined, bloatable6 joined, notable6 joined, coverable6 joined 04:06 sourceable6 joined, quotable6 joined, statisfiable6 joined, committable6 joined, bisectable6 joined, shareable6 joined, nativecallable6 joined 04:23 jpn joined 04:28 jpn left 05:05 andydude left 05:19 Sauvin left 05:47 Sauvin joined 05:49 swaggboi left 05:56 jpn joined 06:00 reportable6 left 06:01 jpn left, reportable6 joined, emakei joined 06:02 swaggboi joined 06:23 deoac left 06:28 jpn joined 06:31 abraxxa joined 06:35 jpn left 06:57 jpn joined 07:04 squashable6 left 07:05 squashable6 joined 07:11 jpn left 07:38 derpydoo left 07:56 Sgeo left 08:05 dakkar joined 08:25 phogg left 08:45 jpn joined 08:59 sena_kun joined 09:06 derpydoo joined
elcaro dealing with a C function that returns a char*. Returning Str is nice, but why can't I return a Buf 09:14
I want the bytes. Sure I can return CArray[int8], but I don't know the size, which means I have to walk the CArray myself until I hit a Null 09:15
Seems NativeCall already does this under the hood, and then decodes to return a Str... Could it not also do the same just without the decode
FWIW, with Python ctypes, one can specify restype as c_char_p, which returns a `bytes` object 09:22
09:28 phogg joined
moritz m: say 42 09:28
camelia 42
moritz camelia build is unstuck, thanks lizmat++ for poking me 09:29
lizmat m: say (1..*).sort[^10] 09:31
camelia Cannot sort a lazy list
in block <unit> at <tmp> line 1
lizmat moritz: that should work on HEAD, so I think camelia is still behind :-(
commit d52342eb0 is the 2022.12 release ? 09:32
moritz that's the newest commit on the master branch
do we have a new main branch name? 09:33
09:33 linkable6 left
lizmat but we're on main nowadays ? 09:33
moritz can somebody please delete "master" then?
09:33 linkable6 joined
moritz it's confusing to have the old branch still lying around 09:33
lizmat I'll bring it up on the RCS 09:34
moritz: and sorry, I thought you'd gotten the memo :-( 09:35
moritz maybe I had, my memory is somewhat leaky these days 09:42
m: say 1 09:45
camelia 1
lizmat hmmm no commit sha?
moritz m: say 1 09:46
camelia 1
lizmat whee! 09:47
m: say (1..*).sort[^10]
camelia (1 2 3 4 5 6 7 8 9 10)
lizmat ^^ this works because .sort knows it's getting a sorted listr already
moritz rakudo can now sort infinite lists, how cool is that :-)
lizmat well, only sorted infinite lists :-) 09:48
10:02 phogg left, phogg joined
andinus m: say (10, -10, |1..*).sort[^10] 10:04
camelia Potential difficulties:
To apply a Slip flattener to a range, parenthesize the whole range.
(Or parenthesize the whole endpoint expression, if you meant that.)
at <tmp>:1
------> say (10, -10, ⏏|1..*).sort[^10]
(-10 …
andinus m: say (10, -10, |(1..*)).sort[^10]
camelia Cannot .sort a lazy list onto a List
in block <unit> at <tmp> line 1
andinus m: say (1..*).sort[^10]
camelia (1 2 3 4 5 6 7 8 9 10)
lizmat (10, -10, |(1..*)) does not produce an iterator that "is-monotonically-increasing" 10:05
andinus i see, makes sense
lizmat hence the error
10:10 emakei left 10:11 emakei joined 10:31 jpn left 10:35 jpn joined 11:10 derpydoo left 11:35 sftp left 11:59 RonaldR34g4m joined 12:00 reportable6 left, reportable6 joined 12:01 Vyrus left 12:16 abraxxa left 12:40 dakkar left 13:05 ProperNoun joined 13:06 ProperNoun left 13:07 ProperNoun joined
andinus how are changed, modified methods on IO different? 13:14
from what i see modified seems to be only for files, changed for directory as well. 13:16
ugexe mtime vs ctime 13:21
vrurg ugexe: Didn't see your reply yesterday. BTW, there is no such thing in userlangd as $*DISTRIBUTION. And $?DISTRIBUTION is precompiled. .meta is exactly what's used because I need to iterate over it. 13:22
andinus my bad, docs differentiate them 13:50
14:07 avuserow left 14:18 tea3po joined 14:22 teatwo left 14:26 emakei left 14:50 Sgeo joined 15:50 greppable6 left, quotable6 left, benchable6 left, reportable6 left, committable6 left, squashable6 left, shareable6 left, bisectable6 left, bloatable6 left, nativecallable6 left, linkable6 left, sourceable6 left, evalable6 left, releasable6 left, tellable6 left, notable6 left, unicodable6 left, statisfiable6 left, coverable6 left, linkable6 joined, tellable6 joined 15:51 nativecallable6 joined, squashable6 joined, releasable6 joined, statisfiable6 joined, sourceable6 joined, committable6 joined, benchable6 joined 15:52 bloatable6 joined, quotable6 joined, coverable6 joined, evalable6 joined 15:53 greppable6 joined, bisectable6 joined, reportable6 joined, unicodable6 joined, notable6 joined, shareable6 joined
leont m: role A { COMPOSE { say "Now" } }; class B does A { } 16:01
camelia ===SORRY!=== Error while compiling <tmp>
Could not instantiate role 'A':
lang-call cannot invoke object of type 'VMNull' belonging to no language
at <tmp>:1
lizmat yeah, the COMPOSE hook was in the legacy grammar. It is currently not in the Raku grammar, afaik 16:05
===SORRY!=== Error while compiling 16:06
Undeclared routine:
COMPOSE used at line -1
leont It would be cool to have it, but in the mean time it should probably give a better error message 16:23
lizmat so what do you think about the ^^ error message ? 16:24
ugexe you can just omit it 16:27
m: role A { say 42 }; say 1; say 1 does A; say 1 does A;
camelia 1
42
1
42
1
ugexe m: role A { say 42 }; say 1; say 2 does A; say 3 does A; 16:28
camelia 1
42
2
3
ugexe hmm, i dont think that is what i expected lol 16:29
disregard, i dunno what im talking about apparently
lizmat the mainline of the role is run the first time it is added to the Int class 16:30
the second time, it uses the cached subtype of Int
ugexe 42 is printed twice in the first example, and only once in the second
lizmat hmmm 16:31
maybe because 1 is one of the pre-existing Int objects? 16:32
ugexe technically i meant to use `but` instead of `does` for those examples, but that is besides the point that i would expect them both to be the same
lizmat so it doesn't get cached with "1"
16:53 linkable6 left, evalable6 left 16:56 evalable6 joined, linkable6 joined 17:40 euandreh left 17:42 jpn left
uzl[m] m: my \b := 1; b := 2; 17:57
camelia ===SORRY!=== Error while compiling <tmp>
Cannot bind to 'b' because it is a term and terms cannot be rebound
at <tmp>:1
------> my \b := 1; b := 2⏏;
tellable6 2023-05-21T00:41:21Z #raku <tbrowder__> uzl[m] Briggs isn't interested. He doesn't mind following his TOC but interested parties would have to deal with his publisher.
hey uzl[m], you have a message: gist.github.com/a34631917cabbaa71f...5bc94a91ee
uzl[m] .tell tbrowder__ Thanks for the heads up! What's the repo mentioned? 17:59
tellable6 uzl[m], I'll pass your message to tbrowder__
uzl[m] m: my \b := 1; b := 2;
camelia ===SORRY!=== Error while compiling <tmp>
Cannot bind to 'b' because it is a term and terms cannot be rebound
at <tmp>:1
------> my \b := 1; b := 2⏏;
uzl[m] m: my $a := 1; $a := 2;
camelia ( no output )
18:00 reportable6 left
uzl[m] Semantically, what's the key difference between sigilless variables and sigilled variables? All this time my understanding was that 1) sigilled variables have a container and sigilless ones don't have one. 18:02
2) Binding to a sigilled variable basically bypassed the container, and you basically ended up with a sigilless variable that happens to have a sigil.
18:02 reportable6 joined
uzl[m] However the fact you can rebind a sigilled variable but not a sigilless one means that bound sigilless variables and sigilled variables aren't the same thing 18:03
* repo mentioned there? 18:04
18:46 squashable6 left 18:47 squashable6 joined
moritz uzl[m]: the main difference is that you can *assign* to a sigiled variable, and that it forces some context 18:58
you cannot assign to a sigilless variable, but binding to one doesn't enforce a context 18:59
for $a, $b -> $x {} # always two iterations
for @a, @b -> $x { } # @a.elems + @b.elems iterations
for sigilless -> $x { } # depends on what's in sigilless how many iterations 19:01
19:36 jpn joined 20:08 jpn left 20:14 avuserow joined 20:33 jpn joined 20:38 jpn left 21:02 sena_kun left 21:27 jpn joined 21:29 coleman_ joined 21:31 tib__ joined 21:37 guifa left, heartburn left, coleman left, tib_ left, a3r0 left, perryprog left, sarna left, coleman_ is now known as coleman, tib__ is now known as tib_ 21:38 a3r0 joined 21:41 sarna joined 22:04 guifa joined, heartburn joined, perryprog joined 22:05 heartburn left, heartburn joined 22:11 jpn left
lizmat m: my @a = 1,2,3; for @a, @a { dd $_ } # moritz that be 2 iterations, after the GLR 22:20
camelia Array @a = [1, 2, 3]
Array @a = [1, 2, 3]
lizmat singla argument rule: only flatten an iterable if it's the only argument 22:21
23:11 linkable6 left, evalable6 left 23:12 evalable6 joined, linkable6 joined 23:14 jpn joined 23:19 jpn left 23:48 jpn joined 23:52 jpn left