🦋 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.
vrurg ugexe: The problem is that as long as I remember, $*DISTRIBUTION is precompiled anyway. Isn't it? 02:06
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
ugexe so if you called .meta<anything else> it would have to read the META6.json file 02:41
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
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
lizmat but we're on main nowadays ? 09:33
moritz can somebody please delete "master" then?
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
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
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
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"
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 )
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.
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
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
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