🦋 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.
tbrowder__ ugexe: thanks, i'll look again. i need to prettify the article anyway 00:29
lizmat: mKing 00:30
**
lizmat: making great progress on hugely improving CSV-Autoclass 'cause i'm using it installed locally for another project. no promises, but i may be able to push out another advent article later. 00:34
02:19 MasterDuke joined 02:48 hulk joined, kylese left 03:15 hulk left, kylese joined 03:28 edr left 03:30 kylese left 03:34 kylese joined 06:28 CIAvash joined 07:13 melezhik joined
melezhik o/ 07:13
say I use some module - "use Foo;"  how can I get a list of exported functions names ? 07:14
as well as class names inside a module's unit name space? 07:15
m: unit module Foo; our sub foo () {say 1} is export; foo() 07:16
camelia ===SORRY!=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> unit module Foo; our sub foo () {say 1}⏏ is export; foo()
expecting any of:
infix
infix s…
melezhik m: unit module Foo; our sub foo () is export {say 1} ; foo()
camelia 1
melezhik m: unit module Foo; our sub foo () is export {say 1} ; say @EXPORT; 07:17
camelia ===SORRY!=== Error while compiling <tmp>
Variable '@EXPORT' is not declared. Did you mean 'EXPORT'?
at <tmp>:1
------> our sub foo () is export {say 1} ; say ⏏@EXPORT;
melezhik m: unit module Foo; our sub foo () is export {say 1} ; say EXPORT;
camelia (EXPORT)
melezhik found here - docs.raku.org/language/modules#Modules 07:20
m: unit module Foo; our sub foo () is export {say 1} ; say Foo::.keys; 07:21
camelia (EXPORT &foo)
melezhik m: unit module Foo; our sub foo () is export {say 1} ; say Foo::DEFAULT::.keys; 07:22
camelia Could not find symbol '&DEFAULT' in 'Foo'
in block <unit> at <tmp> line 1
melezhik m: unit module Foo; our sub foo () is export {say 1} ; say Foo::Export::DEFAULT::.keys;
camelia Could not find symbol '&DEFAULT' in 'Foo::Export'
in block <unit> at <tmp> line 1
melezhik m: unit module Foo; our sub foo () is export {say 1} ; say Foo::EXPORT::DEFAULT::.keys;
camelia (&foo)
melezhik m: unit module Foo; our sub foo (Int $s) is export {say 1} ; for Foo::EXPORT::DEFAULT::.keys -> $f () { say $f.signature }; 07:23
camelia Cannot unpack or Capture `&foo`.
To create a Capture, add parentheses: \(...)
If unpacking in a signature, perhaps you needlessly used parentheses? -> ($x) {} vs. -> $x {}
or missed `:` in signature unpacking? -> &c:(Int) {}
in block at <tm…
melezhik m: unit module Foo; our sub foo (Int $s) is export {say 1} ; for Foo::EXPORT::DEFAULT::.keys -> $f () { say $f().signature };
camelia Cannot unpack or Capture `&foo`.
To create a Capture, add parentheses: \(...)
If unpacking in a signature, perhaps you needlessly used parentheses? -> ($x) {} vs. -> $x {}
or missed `:` in signature unpacking? -> &c:(Int) {}
in block at <tm…
melezhik m: unit module Foo; our sub foo (Int $s) is export {say 1} ; for Foo::EXPORT::DEFAULT::.keys -> $f () { say &$f().signature }; 07:24
camelia Cannot unpack or Capture `&foo`.
To create a Capture, add parentheses: \(...)
If unpacking in a signature, perhaps you needlessly used parentheses? -> ($x) {} vs. -> $x {}
or missed `:` in signature unpacking? -> &c:(Int) {}
in block at <tm…
melezhik m: unit module Foo; our sub foo (Int $s) is export {say 1} ; for Foo::EXPORT::DEFAULT::.keys -> $f () { say &::($f).signature }; 07:27
camelia Cannot unpack or Capture `&foo`.
To create a Capture, add parentheses: \(...)
If unpacking in a signature, perhaps you needlessly used parentheses? -> ($x) {} vs. -> $x {}
or missed `:` in signature unpacking? -> &c:(Int) {}
in block at <tm…
melezhik m: unit module Foo; our sub foo (Int $s) is export {say 1} ; for Foo::EXPORT::DEFAULT::.keys -> $f () { say &::($f.^name).signature }; 07:28
camelia Cannot unpack or Capture `&foo`.
To create a Capture, add parentheses: \(...)
If unpacking in a signature, perhaps you needlessly used parentheses? -> ($x) {} vs. -> $x {}
or missed `:` in signature unpacking? -> &c:(Int) {}
in block at <tm…
melezhik m: unit module Foo; our sub foo (Int $s) is export {say 1} ; for Foo::EXPORT::DEFAULT::.keys -> $f () { say $f.Str }; 07:29
camelia Cannot unpack or Capture `&foo`.
To create a Capture, add parentheses: \(...)
If unpacking in a signature, perhaps you needlessly used parentheses? -> ($x) {} vs. -> $x {}
or missed `:` in signature unpacking? -> &c:(Int) {}
in block at <tm…
melezhik m: unit module Foo; our sub foo (Int $s) is export {say 1} ; for Foo::EXPORT::DEFAULT::.keys -> $f () { say $f };
camelia Cannot unpack or Capture `&foo`.
To create a Capture, add parentheses: \(...)
If unpacking in a signature, perhaps you needlessly used parentheses? -> ($x) {} vs. -> $x {}
or missed `:` in signature unpacking? -> &c:(Int) {}
in block at <tm…
melezhik m: unit module Foo; our sub foo (Int $s) is export {say 1} ; for Foo::EXPORT::DEFAULT::.keys -> $i () { my &f = Foo::EXPORT::DEFAULT::{$I}; say &f.name; say &f.signature;  }; 07:50
camelia ===SORRY!=== Error while compiling <tmp>
Variable '$I' is not declared. Did you mean '$i'?
at <tmp>:1
------> $i () { my &f = Foo::EXPORT::DEFAULT::{⏏$I}; say &f.name; say &f.signature;  };
melezhik m: unit module Foo; our sub foo (Int $s) is export {say 1} ; for Foo::EXPORT::DEFAULT::.keys -> $i () { my &f = Foo::EXPORT::DEFAULT::{$i}; say &f.name; say &f.signature;  };
camelia Cannot unpack or Capture `&foo`.
To create a Capture, add parentheses: \(...)
If unpacking in a signature, perhaps you needlessly used parentheses? -> ($x) {} vs. -> $x {}
or missed `:` in signature unpacking? -> &c:(Int) {}
in block at <tm…
melezhik m: unit module Foo; our sub foo (Int $s) is export {say 1000} ; for Foo::EXPORT::DEFAULT::.keys -> $i { my &f = Foo::EXPORT::DEFAULT::{$i}; say &f.name; say &f.signature; } 07:51
camelia foo
(Int $s)
melezhik works now )) 07:52
07:53 CIAvash left 08:04 melezhik left 08:19 gdown left 09:00 lichtkind_ joined 09:04 jpn joined 09:10 melezhik joined 09:11 jpn left
melezhik how can I iterate though all symbols provide by module export (exported functions) when requiring  module (not loading it) ? 09:11
docs.raku.org/language/modules#require example only shows how to reference to a specific symbol (function name), but I would like to iterate through all of them 09:12
looks like this - 'require Foo;  say Foo::.keys' 09:20
09:35 sena_kun joined 09:42 melezhik left 09:47 jpn joined 10:06 clarkema1 left 10:26 jpn left 10:34 jpn joined 11:45 Sgeo left 12:28 jpn left 12:45 perlbot left, simcop2387 left 12:55 jpn joined 12:57 simcop2387 joined 12:58 perlbot joined 13:16 jpn left 13:42 jpn joined 14:00 MasterDuke left 14:04 jpn left 14:20 jpn joined 14:54 djuber` joined, djuber` left 15:40 mcmillhj joined 15:55 kylese left 15:57 kylese joined 15:58 clarkema1 joined 16:18 john joined, john is now known as Guest8461 16:47 mcmillhj left 17:01 Guest8461 left 17:14 lichtkind__ joined 17:17 lichtkind_ left 17:18 gfldex joined 17:21 jpn left 17:25 jpn joined 17:37 simcop2387 left, perlbot left 17:48 simcop2387 joined 17:49 perlbot joined 17:50 perlbot left, simcop2387 left 18:00 simcop2387 joined 18:02 perlbot joined 18:07 simcop2387 left, perlbot left 18:29 simcop2387 joined 18:31 perlbot joined 18:34 simcop2387 left, perlbot left 18:48 simcop2387 joined, simcop2387 left 18:58 simcop2387 joined 18:59 perlbot joined 19:00 perlbot left, simcop2387 left
Xliff \o 19:50
Who is running raku.lang?
19:51 Sgeo joined 19:53 simcop2387 joined 19:55 perlbot joined
lizmat Xliff: you mean raku.land? 19:59
raku-advent.blog/2023/12/02/an-upd...raku-land/
Xliff Yes, who is running it.
19:59 Xliff_ left 20:06 jpn left
Xliff I need help setting up my local copyh of raku.land -- has anyone done it before? I have the docker container running, but there is no site. 20:12
20:21 jpn joined 20:23 perlbot left, simcop2387 left 20:29 jpn left 20:47 simcop2387 joined 20:48 perlbot joined
librasteve what port mapping in docker run cmd? 20:49
21:18 jpn joined 21:23 jpn left 21:51 eseyman left 22:13 manu_ joined, manu_ is now known as eseyman
lizmat Xliff: you might get more direct help on #raku-land 23:01
clarkema1 I decided to have a play around with testing Readline on openbsd, just for fun. On a fresh installation of 7.4, I had to patch zef's tar detection routine to get it to work, but am now encoutering the following: gist.github.com/clarkema/ec15c0fbc...6ab47d3b7a 23:07
I'm at a bit of a loss as to why it would be failing to recognise, or (alternatively) incorrectly creating the 'dist' directory just on openbsd
I've tried getting it to use gnu tar for the extraction just in case that was making a difference, but that doesn't seem to have helped -- any ideas welcome! 23:08
23:13 sena_kun left, sena_kun joined 23:14 sena_kun left 23:16 antim0d3s joined 23:17 sdfgsdfg left
clarkema1 ah, never mind -- it _is_ a gnu vs bsd tar issue. I'll keep digging 23:20
23:27 jpn joined
ugexe what did you need to update re tar detection? 23:32
23:32 jpn left
clarkema1 ugexe: I'll do a PR once I've run down the second issue, but in short github.com/ugexe/zef/blob/main/lib...akumod#L93 23:34
just running bare 'tar' on openbsd doesn't output any of the magic words
obsd-test$ tar
tar: Failed open to read on /dev/rst0: Permission denied
So I changed to BEGIN my @needles = <archive file specify /dev/rst0:>; 23:35
ugexe I dont remember how I came up with that detection on openbsd 🤔
clarkema1 Tested on 7.4, and I've checked the bare tar output on an old 6.8 machine and it's the same 23:36
bare tar on FreeBSD gives this: `tar: Must specify one of -c, -r, -t, -u, -x`, so maybe it used to look similar on openbsd, but if so it was at least prior to 6.8 23:38
ugexe i probably just asked chatgpt to pretend to be an openbsd command prompt or something
clarkema1 lol
ugexe i guess there is no way to get a more... complete?... help output? 23:40
clarkema1 it doesn't appear so, other than by making it barf to generate a usage message 23:41
gist.github.com/clarkema/7ead2ff13...8388432466 23:42
of course, an openbsd installation that doesn't have /bin/tar is pretty damn broken, so its presence could be assumed
The second issue is a missing 'z' flag further down the file, which gnu tar is cool with but not bsd tar 23:47
just testing now
ugexe i'm not sure it is bsdtar, because macos and windows both come with bsdtar and work 23:49
clarkema1 ah, well maybe it's just openbsd /bin/tar being special then. I have no idea when they all forked off each other
how do you feel about the detection change, before I do a PR? Would you prefer some other test? 23:52
ugexe I'm fine with making the detection work, i'm just not sure the best way to do it. Adding a check for `/dev/rst0:` probably doesn't work if /dev/rst0 actually exists. adding a random flag can potentially break in a future version of tar. Ideally there would be some parameter/flags that could be used to get either a 0 exit code or deterministic output. I'd accept a PR regardless as long as some 23:55
consideration is given to those concerns before submitting though
clarkema1 Fair point. Sadly I don'th have a tape drive lying around 23:56
One option could be to ship the world's smallest tar file and try to extract it 23:57
ugexe ah, is /dev/rst0 always gonna be a tape drive?
clarkema1 yeah
ugexe ah, then maybe it is fair to check for that then. if someone has a tape drive i suppose they can file a bug report and then we'll figure out a better option
clarkema1 tar -cf - exits silently and succesfully 23:59