🦋 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.
Xliff m: sub a ( say OUTER::&?ROUTINE.name }; sub b { a() }; b() 01:09
camelia ===SORRY!=== Error while compiling <tmp>
Invalid typename 'say' in parameter declaration.
at <tmp>:1
------> sub a ( say⏏ OUTER::&?ROUTINE.name }; sub b { a() };
Xliff m: sub a { say OUTER::&?ROUTINE.name }; sub b { a() }; b()
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared name:
ROUTINE used at line 1. Did you mean 'Routine'?
Xliff m: sub a { say OUTER::a }; sub b { my $a = 42; a() }; b()
camelia Nil
Xliff m: sub a { say $OUTER::a }; sub b { my $a = 42; a() }; b()
camelia Nil
jaguart m: sub a { say OUTER::.keys }; sub b { my $x = 42; a() }; b() 03:04
camelia (GLOBALish $=pod EXPORT &b $! ::?PACKAGE !UNIT_MARKER $=finish $?PACKAGE $_ $¢ $/ &a)
jaguart m: sub a { say CALLER::.keys }; sub b { my $x = 42; a() }; b() 03:05
camelia ($¢ $/ $! $x)
jaguart m: sub a { say CALLER::<$x> }; sub b { my $x is dynamic = 42; a() }; b() 03:07
camelia 42
jaguart anyone else having github action failure for TAP v0.3.11 install in Windows VM? 04:30
Nemokosch how does one get native 'pq' dependency fulfilled (for the DB::Pg module) on Mac? 12:37
tellable6 2022-12-27T21:54:18Z #raku <vrurg> Nemokosch: how could it? Iterables are mutable by definition.
2022-12-31T00:37:58Z #raku <Xliff> Nemokosch: However in the immediate sense, there is a definite need for answers you may not have and someone else does :P\
2022-12-31T14:46:22Z #raku <Voldenet> Nemokosch: C vulnerabilities just didn't matter in times before everything was connected to everything else ;)
2023-01-02T14:08:34Z #raku <lizmat> Nemokosch: thanks for the headsup... looks like a restart fixed it :-)
hey Nemokosch, you have a message: gist.github.com/73b5dd46a484807743...bfad98e479
Nemokosch pfff
Voldenet `brew install libpq` maybe 13:02
my constant LIBPQ = NativeLibs::Searcher.at-runtime('pq', 'PQstatus', 5);
this is used to find it 13:03
Nemokosch you know, the problem is that I'm posting someone else's question so context is kinda lacking. From what I gather, though DB::Pq itself 'decides' where it looks for this "native dependency" 13:05
and I think one way or another, it looks for something literally called 'pq'
libpq is installed 13:06
my guess was that a well-chosen symlink might do the trick
Voldenet >$*VM.platform-library-name("pq".IO).say 13:08
>"libpq.so".IO
the above is used to resolve the cannon-name in this case 13:09
leont jaguart: would like to know more about that TAP issue 13:10
Nemokosch: this is the moment to promote Net::Postgress, right? ;-) 13:12
Nemokosch Probably 13:13
Well, can you recommend it? :P 13:14
lizmat Nemokosch: leont is the author :-) 13:17
leont I think it's great, not only because it doesn't have the external library but especially because it's actually asynchronous 13:17
leont It's only disadvantage right now is that it doesn't support unix domain sockets, because Raku doesn't support (asynchronous) unix domain sockets yet. 13:18
(I might try fixing that in moarvm, but async moar is a bit hard to get into) 13:19
lizmat wouldn't that require libuv support ? 13:20
leont libuv does support it, but in a weird way 13:21
leont You use the weirdly named uv_pipe_bind/uv_pipe_connect functions 13:22
lizmat well, if the naming is the only weird thing... 13:23
leont I suspect an expert can do it really quickly. I probably could do it myself, but I first have to figure out a bunch of stuff about moar 13:49
There's a similar lack of async pipe support, but that's probably a harder one to fix
lizmat leont: your PR ready for merging ? 13:50
thundergnat leont: I also have had a lot of failures with recent CI TAP failures (Almost exclusively for Windows) 13:57
tellable6 2022-11-30T23:27:03Z #raku <guifa> thundergnat: I mean, that's a good example of it, and of course the standard action classes methods are another
thundergnat One of my recent updates I had to re-run the test job 13 times before it passed. 13:58
github.com/thundergnat/String-Spli...6455803271
It doesn't seem like it is specifically a problem with TAP, it just keeps failing to install. 13:59
Eventually, changing nothing, it will install TAP, APP::Prove6 and pass. 14:00
ugexe thundergnat: i've been trying to add a gh action for zef and i've never gotten it to finish the various tests
its similar to what you describe, except there are so many more tests i dont think i'll ever get a lucky run 14:01
thundergnat Yeah. I get it to eventually pass, but it can take anywhere from 3 to 15 reruns of the test job
ugexe none of these problems exists on a local windows vm, or using appveyor
thundergnat Mine don't fail _module testing_, they fail to install TAP. I've tried to get further diagnostics but haven't been successful 14:03
Just "Failed to install TAP. Process completed with exit code 1."
leont The "sometimes it succeeds" it the real mystery here. If it consistently failed at least I'd have an idea. 14:04
leont I did change the newline logic recently, I'm guessing that to be the cause, but that wouldn't explain why it sometimes succeeds. 14:04
thundergnat It is _only_ (for me) under Windows. It installs for Linux first time _every_ time.  First time for Mac maybe 90% of the time. Windows, maybe 5% of the time. 14:06
And reruning the same job under Windows, it eventually loads and passes. But it usually takes 5 to 15 retries. Quite frustrating. 14:07
I don't even think it is specifically a problem with TAP or Prove6. Seems more like weird interactions / timings issues in the github actions CI Windows VM. (Speculation) 14:09
Running / installing them locally has always been trouble free
Don't know if there is even anything that can be done about it but I figured I would say something about it in case there is. 14:11
If nobody reports a problem it _definitely_ won't get fixed. ;-) 14:12
leont I see a bunch of tests failing on main, I assume that's not expected 15:08
ab5tract Hey all, hope everyone is doing well! Does anyone know if this behavior (flattening of hashes into pairs by slurpy subs) is to be expected? Seems unfortunate that I need to "scalarize" the container... 15:16
m: sub slurpy(*@a) { for @a { dd $_ } }; slurpy({pair => 1, foo => 2}, ${ as => 1, expected => 2}) 15:17
camelia :pair(1)
:foo(2)
${:as(1), :expected(2)}
Nemokosch hello 15:20
keep in mind that *@a - with the single asterisk - is the flattening slurpy in general
as opposed to the **@ slurpy 15:21
m: sub slurpy(**@a) { for @a { dd $_ } }; slurpy({pair => 1, foo => 2}, { as => 1, expected => 2}) 15:22
camelia ${:foo(2), :pair(1)}
${:as(1), :expected(2)}
Nemokosch aha, seems like this works indeed 15:23
ab5tract Nemokosch: awesome, I had a feeling that would be the answer 16:01
thank you for responding
mcmillhj I am trying to write a function to merge overlapping Ranges. I typed the function as `sub merge(Range @ranges)` but am having trouble when passing in data from a `map` expression. I know that map returns a `Seq` but how do I properly translate from `Seq` to `Positional`? Small example of what I am trying to do: topaz.github.io/paste/#XQAAAQ 16:54
BjAwAAAAAAAAA5nUhjF5Wcttn1SqJE5qVUJpgaefQ+bUWHNIkNhaaQhE6Zfm7l+4QC6ZOKlfiSh/f1V4nS5zcEZgLbLisIRxy5uQDuW9XjcvktmqwzlKX7pqdtvF7iuKj8QfL0kP94P4pBisCRajtF7jfAlUOIgXRClx4KlA2e6xecHFXuI63YD0jkFVNoq6yC5MjwXT18lz595ZkRDX7hToKZ1JKAXoO+dMaPlO53uTQeKu805QxYZL5DoYJhmfCrVfVB3aVKhRcb5RFhAPiIB/XmCTlBugOVN8xnUrQlfzJK2xZ0LyTDEXfacUucYIvx4VjWIwZxJwSxF4i8RlSB3FYc2jhd
ixSc+JvaiGU95FdRnBX1DqaI27SmOSai+jgSfA7BnRlRNf+Aly9IYRILkKp/QLw0ezOPqtsRNMygWlwAcyCwEapLg9Ma79b11l84xkAa+lQz+jsb/16lQNJNfVkp4r/wTJv/xNoucnx3nNSZ5krcxWAF+yVeJIvKZAglhAwJ5Y5cl4qlskUDafu0xVXGgSIQX10rR8ol2TlwWYcH0MoHn29pRBF/ZkE+uJYh60Hjrwbwsvf55mZDn//18Bn+
ugexe $seq.List ? 17:03
mcmillhj I have tried both `.List ` and `.Array` which implement `Positional` but both show the same error: `Type check failed in binding to parameter '@ranges'; expected Positional[Range] but got Array ([-8..12, 6..10, 12.....)` 17:05
NemokoschKiwi literals don't work great with typing; they aren't inferred to the tightest type 17:12
m: my Range @ranges = [-8..12, 6..10, 12..14, 14..26]; 17:14
camelia ( no output )
NemokoschKiwi hmmm, not even bad...
NemokoschKiwi Then we can mangle the question a little bit: is there a way for a map to preserve the typing? 17:16
mcmillhj hmm okay, the real program isn't using literals. This was just how I could reproduce the issue in a small snippet.
NemokoschKiwi Well, you did your best: assigned the literal to a typed variable. It was the map that lost the type, I'm afraid 17:17
m: Seq[Int] $foo; 17:19
camelia ===SORRY!=== Error while compiling <tmp>
Seq cannot be parameterized
at <tmp>:1
------> Seq[Int]⏏ $foo;
NemokoschKiwi well that's quite a problem... why can't it, really
Nemokosch test test 17:21
*resurrection* 😄 17:22
NemokoschKiwi mcmillhj: a more "imperative" check is surely possible, like `@ranges where *.all ~~ Range` or something 17:39
on the somewhat longer run, I think it really should be investigated how better typing can be supported for compound types, at least in an opt-in fashion
Xliff I have a token, defined as 'token dc { "::" }'. I want to parse it globally. How can I do this using the "$content ~~ ::('&dc')" form of the call? 20:30
m: token a { 'a' }; "Alpha Malpha Malp".match( &a, :g ).gist.say
camelia ===SORRY!===
Undeclared routine:
a used at line 1

Other potential difficulties:
Useless declaration of a has-scoped method in mainline (did you mean 'my token a'?)
at <tmp>:1
------> token ⏏a { 'a' }; "Alph…
Xliff m: my token a { 'a' }; "Alpha Malpha Malp".match( &a, :g ).gist.say
camelia (「a」 「a」 「a」 「a」)
Xliff Ohhh.
m: my token a { 'a' }; "Alpha Malpha Malp".match( ::('a'), :g ).gist.say
camelia No such symbol 'a'
in block <unit> at <tmp> line 1
Xliff m: my token a { 'a' }; "Alpha Malpha Malp".match( ::('&a'), :g ).gist.say
m: my token a { 'a' }; "Alpha Malpha Malp".match( ::('&a'), :g ).gist.say 20:31
camelia (「a」 「a」 「a」 「a」)
Xliff Nifty!
jaguart leont: I see others reporting the same - Install [FAIL] for TAP - here's all I have... github.com/jaguart/Grok/actions/ru...#step:5:17 22:45
leont This is annoying. Why doesn't zef install have a verbose mode, so we'd actually have an idea what's going on 22:47
jaguart wondering if its the old too-long-filename problem... 22:50
just running it more times - mostly it's a TAP install fail - but once was Archive Not Found 22:51
I'll see if I can get the --verbose flag going 22:52
jaguart lol no failure with --verbose :) - it knows I'm watching... a heisenbug 22:56
Nemokosch zef install does have a verbose mode and indeed I can confirm: it often DOES install when you have --verbose on 22:58
having said that, by now, TAP has definitely developed negative connotations for me
jaguart ok - even with --verbose, no more info on TAP install failure... going for --debug 23:05
I've isolated TAP install into its own step with debug: github.com/jaguart/Grok/actions/ru...6525402330 23:13
because - was wondering if fail was due to something in the chain... 23:14
leont That does sound like it's a zef problem, but doesn't actually explain anything
jaguart I will try a few other things... open to suggestions? 23:15
ugexe typically '===> Install [FAIL] ' means a precompilation failure from rakudo
it could indeed be the path-too-long issue that arises with certain precompilation file names that get generated 23:16
jaguart can you see any clues here? github.com/jaguart/Grok/actions/ru...6525482776 23:19
ugexe fwiw i've had no luck getting raku github actions working reliably on windows despite everything i've tried working fine on appveyor and on local windows vms 23:20
leont: zef outputs whatever information it gets from the result of CompUnit::Repository::Installation.install(...) when ran with --debug. i'm kind of guessing its a compile error during install but usually the stderr message gets printed for that (but maybe doens't always get flushed) 23:24
leont --verbose and --debug don't show up on «zef install --help», that had me confused 23:26
ugexe jaguart: for that last link that looks like it could be the path link thing. i use github.com/ugexe/zef/blob/9779091b...yml#L9-L10 to get around that issue by shaving off some of the temporary path length
jaguart Here's a failed run with all the guff: github.com/jaguart/Grok/actions/ru...6525547817
ab5tract how do I get the IO location of the script, rather than the $*CWD? 23:27
ugexe $*PROGRAM
ab5tract thanksu ugexe!
ugexe jaguart: actually maybe not. the path length issue results in saying it cant find files that should exist i think 23:28
jaguart longest paths in the logs are only 130 chars
so well < the 254 limits 23:29
ab5tract hmmm, that actually won't be what I want... use case: loading a sound file from the package directory. IIUC, the script file will be installed into ~/.raku/bin, which is I guess where $*PROGRAM will point to 23:30
jaguart ab5tract: are you looking for docs.raku.org/language/variables#%?RESOURCES 23:32
ab5tract jaguart: that's exactly what I need 23:33
jaguart ugexe: I'm stymied on the TAP install - though it is a good case as it fails almost consistently. Let me know if you think there is anything else I can try 23:35
leont It's a relatively big module (with many classes), maybe something chokes on that? 23:36
ugexe something else i'd try is installing it with the following flags: `--/prove --/tap --raku-test` (i.e. only use the tester that does `raku -I. t/*.t`) just to rule our attempting to load TAP prior to install isn't somehow affecting it 23:37
jaguart umm: --/tap ? 23:40
ugexe sorry, --/tap-harness
if you want to rule out zef you could install tap::harness by cloning its repo, changing into that directory, and running something like `raku -e 'CompUnit::RepositoryRegistry.repository-for-name("site").install(Distribution::Path.new($*CWD))'` 23:41
jaguart ok - lets try zef options first...
ugexe note that won't help with the test failure part though
jaguart same fail with: zef install --debug TAP --force-test --/prove --raku-test --/tap-harness 23:43
github.com/jaguart/Grok/actions/ru...6525700597
ugexe i figured up an appveyor run that will try to install TAP ci.appveyor.com/project/ugexe/zef/...s/45831355 23:44
s/figured/fired/
jaguart this is like distributed TV watching... 23:47
ugexe its gonna build rakudo from source so it'll take a minute 23:48
ugexe ci.appveyor.com/project/ugexe/zef/...1355#L1291 23:59
it installed fine there