timo you could try a few different things, like using Table:D: for the invocant, and/or making the candidate either explicitly take an Int:D for the position, or at least add a candidate that takes it and convert to Int in your more general candidate, or use a coercive type for the parameter 00:22
librasteve PS. when I say "my :hammer adverb" what I mean is the :hammer adverb that I suggested and that lizmat actually implemented, tested, released and documented 00:37
:sorry: 00:38
wayland76: if you go fez upload then the module is available for install via zef install XYZ immediately provided that you clear you local zef caches. I usually go (i) zef install . --force-install, (ii) fez upload, (iii) zef update, (iv) zef install XYZ --force-install and check my new version number is coming in ... all of this is in realtime (no need to wait) 00:50
the thing that can take a while is for raku.land to index your module on its regular trawl --- iirc that's once per hour
wayland timo: Thanks! Making the Table one take a specific Int:D solved it :) 00:52
librasteve: Great! I've added a comment to my release script that suggests items iii and iv from your suggestion. My script does ii itself. What's the purpose of item i ? 00:56
librasteve: Regarding the indexing, that's good to know; thanks! :) 00:57
librasteve well this is just my release process ... the reason I do (i) before I fez upload is a last check that all the Build.pm and so on at least runs locally to avoid silly errors 00:58
btw I am also learning to love App::Mi6 ... although it has some quirks 00:59
wayland Yeah, my release process does some checks. But maybe I need to look into Build.pm.
librasteve yeah, Build.pm and $?RESOURCES is a bit of a learning curve ... but well worth the effort in the long run (and is good alignment with future package management security controls iiuc) 01:01
wayland App::Mi6 looks nice, but I have mine set up to build it all in docker containers. That means I can have the latest release in the docker container. I can also use the process to run tests in a github action, and the like. 01:02
01:44 kylese left 01:45 kylese joined 02:15 kylese left, kylese joined 02:30 kylese left 02:34 kylese joined 03:51 xinming_ left 03:53 xinming_ joined 04:02 xinming_ left 04:04 xinming_ joined
wayland m: my $o; ["foo"].flat ==> $o; say $o 04:09
camelia [foo]
wayland How do I get $o to be the first element of the array ("foo") instead of the array itself? While keeping the feed operators. 04:11
04:14 xinming_ left, xinming__ joined 04:33 Aedil joined
wayland m: my $o; ["foo"].flat ==> ($o); say $o 04:49
camelia ===SORRY!=== Error while compiling <tmp>
Only routine calls or variables that can '.append' may appear on either side
of feed operators.
at <tmp>:1
------> my $o; ["foo"].flat ==> ⏏($o); say $o
wayland That's the one I would've expected to work. 04:50
m: my ($o); ["foo"] ==> ($o,); say $o 05:05
camelia ===SORRY!=== Error while compiling <tmp>
Only routine calls or variables that can '.append' may appear on either side
of feed operators.
at <tmp>:1
------> my ($o); ["foo"] ==> ⏏($o,); say $o
wayland Actually, that's the one I would've expected to work.
timo m: my $o; my class Nom { has $!tgt; method new($tgt is rw) { $!tgt := $tgt }; method append(*@a) { $!tgt = @a.head } }; ["foo"].flat ==> Nom.new($o); say $o 05:11
camelia ===SORRY!=== Error while compiling <tmp>
Only routine calls or variables that can '.append' may appear on either side
of feed operators.
at <tmp>:1
------> !tgt = @a.head } }; ["foo"].flat ==> Nom⏏.new($o); say $o
timo m: my $o; my class Nom { has $!tgt; method new($tgt is rw) { $!tgt := $tgt }; method append(*@a) { $!tgt = @a.head } }; my $n = Nom.new($o); ["foo"].flat ==> $n; say $o
camelia Cannot bind attributes in a Nom type object. Did you forget a '.new'?
in method new at <tmp> line 1
in block <unit> at <tmp> line 1
timo m: my $o; my class Nom { has $!tgt; method new($tgt is rw) { self.bless(:$tgt) }; submethod TWEAK(:$!tgt is rw) {}; method append(*@a) { $!tgt = @a.head } }; my $n = Nom.new($o); ["foo"].flat ==> $n; say $o 05:12
camelia ===SORRY!=== Error while compiling <tmp>
Cannot use 'is rw' on optional parameter '$!tgt'.
at <tmp>:1
timo m: my $o; my class Nom { has $!tgt; method new($tgt is rw) { self.bless(:$tgt) }; submethod TWEAK(:$!tgt! is rw) {}; method append(*@a) { $!tgt = @a.head } }; my $n = Nom.new($o); ["foo"].flat ==> $n; say $o
camelia (Any)
timo hrmpf.
wayland Actually, it doesn't have to be a feed operator, as long as the variable(s) that I'm putting it into are at the end of the line. 05:13
timo m: my $target; ($_,) = ["foo"] given $target; say $target 05:14
camelia foo
timo m: my $o; my class Nom { has $.tgt; method append(*@a) { $!tgt(@a.head) } }; my $n = Nom.new(tgt => { $o = $_ }); ["foo"].flat ==> $n; say $o
camelia foo
wayland Hmm. I don't think that's going to help in my quest to make my code more readable. But thanks for confirming that there wasn't an easy answer. 05:16
timo m: my $tgt; ["foo"].head.&{ $tgt = $_ }; say $tgt 05:17
camelia foo
timo m: my $tgt; ["foo"].head.&{ $_ R= $tgt }; say $tgt
camelia foo
timo oh
m: ["foo"] R= my ($o,); say $o
camelia foo
05:23 lizmat left
timo don't forget the , but it probably asplodes if the array is longer? 05:24
m: ["foo", "bar"] R= my ($o,); say $o
camelia foo
timo oh cool it doesn't asplode
05:31 Aedil left
wayland Nice! 06:40
Is it possible to call a method inherited from the parent in a TWEAK or new method? 06:50
timo you can always call a specific class's method on something like $foo.Class::methodname() i think
ClassName::methodname that is 06:51
m: say ["hi"].raku; say ["hi"].Any::raku
camelia ["hi"]
Array.new
wayland Hmm. I managed to get it to say: Cannot find method 'unshift' on object of type NQPMu 06:56
...and I'm not even calling unshift :) ??? 06:59
timo `rakudo --ll-exception` will make backtraces show frames from inside rakudo
wayland Oh, great! I'll try that if I can't figure out something soon. 07:00
07:02 ptc joined 07:22 Aedil joined 07:29 bisectable6 left 07:30 ptc left 07:32 bisectable6 joined 07:45 eseyman left 07:49 manu_ joined 08:27 lizmat_ left, lizmat joined 08:28 Geth joined 08:40 floyza left 08:50 lizmat_ joined 08:57 lizmat_ left 09:02 lizmat_ joined 09:20 sena_kun joined 09:55 Sgeo_ left 11:18 wayland76 joined, wayland left 11:45 lizmat__ joined 11:46 lizmat_ left 12:36 xinming__ left 12:37 xinming_ joined 13:40 lizmat__ left 14:11 ptc joined 14:28 ptc left 14:36 Manifest0 joined 14:58 abraxxa-home joined 15:10 abraxxa-home left 15:27 xinming_ left 15:29 xinming_ joined 16:35 gfldex left 16:42 gfldex joined 16:55 Aedil left 16:57 Aedil joined 17:12 xinming_ left 17:15 xinming_ joined 17:33 xinming_ left 17:35 xinming_ joined 18:01 Manifest joined, xinming_ left 18:02 xinming_ joined 18:19 Aedil left 18:20 xinming_ left 18:21 xinming_ joined
tbrowder hi 18:25
bye 18:26
alrighty, i have a chicken and egg situation again. is there any way, with an INSTALLED distribution, to get the actual file names under the module's /resources dir without actually cloning it? i know i can use a pre-publish script with App::Mi6 to create an arra 18:33
*a list of names inside a lib/*/SomeModule.rakumod to do it (or use Build.rakumod). 18:36
18:38 Geth left, Geth joined
tbrowder But I can't make the magic happen with $?DISTRIBUTION and %?RESOURCES 18:41
[Coke] Have the module tell you. 18:42
it can use %?RESOURCES, no?
if you're asking for an arbitrary module - why do you need that? 18:43
tbrowder theoretcally, but i've tried it my installed test module. i want to create a published module from which a user can download the resources from that module without cloning it. 18:45
as i said, i can do it with a Build module and script, but the user should just be able to "use Foo" and then say show-resources 18:48
if i read the docs correctly 18:49
if the installed module knows the paths, then it should work, but i haven't done it successfully yet 18:52
maybe use one of the published Zef modules 18:54
afk&
19:06 Sgeo joined
tbrowder back... 19:10
i also look at zef github and see reference to @ugexe saying Build would probably never do away, but did show was to use a Makefile. maybe that's better (and easier) than Build. 19:30
s/do/go
ummm, not easier for me... 19:40
19:52 xinming_ left 19:53 xinming_ joined
timo i seem to recall the design of RESOURCES and such was so that one of the entries doesn't have to be backed by one file on disk necessarily 20:13
ab5tract tbrowder:I think I’m missing something here because my naive response would be: what’s the actually problem? If it’s about resources that are associated with a module that you are the author of, can’t you provide this show-resources sub as an export from that module? 20:23
s/actually/actual/ 20:24
If it’s someone else’s module, it seems like you could also link to any resources via http by combining the source url and the resource listing in the relevant meta6.json 20:26
tbrowder yeah, i'm trying both suggestions but no luck yet 20:27
ignore that response. 20:28
i'm trying to NOT do double work. the problem with the sub is the actual file contents have to be reachable by the installed module. 20:30
any code in the module has to be accessed via the RESOURCES or DISTRIBUTION spcial variables 20:33
but one has to know the path name to get it so it seems i neeed to list the file names in the m 20:36
META as well as the put the actual file in the /resources directory 20:37
20:42 Manifest0 left
tbrowder and i'm trying to create a linter (part to check for that in an installed module... 20:43
my brain isn'shifting gears fast enough... 20:44
timo i'm not sure how resources and linting relate to each other exactly; are you trying to make a linter rule that ensures that any time the code mentions %?RESOURCES<bla/bla/bla> that the path is actually valid? 20:54
tbrowder for the original module i'll try using mi6 to create or check the META6.json file has the correct entries matching the actual files in the local /resources file
ideally, but not necessarily. the first goal. the first is to have linter pointed at an uninstalled source repo 20:57
i'm working on both at the same time...ouch 20:58
timo ah, that could prove to be tricky, indeed 20:59
you may have to decide what kind of stuff you'll allow the module author to do in their BUILD.raku (or is it rakumod?) without stepping outside of what you are willing to support 21:00
tbrowder keeps the synapses sparking, but too many large spaces
roger 21:01
good point
timo where does your linter sit in relation to Test::META6? that one just checks the meta6.json, but your linter could perhaps be invoked in a similar manner, in other words by putting an xt/browderlint.t that does something like `use Browder::Linter; run-lint()` (i don't know what you're going to call this module)
AFKBBL 21:02
tbrowder its a part of my next-ver branch of Mi6::Helper 21:03
the bin file call the lint sub 21:04
calls
timo: ok, making some progress, thanks for helpful comments 21:46
m: my $a="0,1,2,3,4,5,6,7,8,9"; my @b = $a.split<,>; my $c = @b[0..^5].join<,>; my $d = @b[5..9].join<,>; say $c; say $d; 22:45
camelia Cannot resolve caller split(Str:D: ); none of these signatures matches:
(Str:D $:: Regex:D $regex, $limit = Whatever;; :$v, :$k, :$kv, :$p, :$skip-empty, *%_ --> Seq:D)
(Str:D $:: Str(Cool) $match;; :$v is copy, :$k, :$kv, :$p, :$skip-empt…
timo $a.split<,> is equivalent to $a.split()<,>
tbrowder thnx 22:46
22:50 sena_kun left
tbrowder i'm really having trouble wity array indexing after a good split. this works: my $a = @b[0..^4].join(",") 22:51
but this doesn't: $b = @b[4..*].join(","); 22:52
a long time ago lizmat showed me how to do it but i forgot. maybe use ... instead of ..? 22:53
docs on splits and joins are very hard to read with so many options and examples 22:55
i'm pretty sure an explanation is there but... 22:56
ab5tract m: dd [1…9][5..*].join(“,”) 22:58
camelia "6,7,8,9"
tbrowder three dots range, ok, thanks, but weird 23:07
ab5tract Oh, the threee dots is entirely accidental
m: dd [1..9][5..*].join(“,”)
camelia "6,7,8,9"
ab5tract 4..* is quite different than ^4 though 23:08
If @b has less than 5 elements, 4..* won’t produce anything as an index value 23:09
Also no need for the 0.. when doing ^4
tbrowder i'll try it offline.. 23:11
erg, how do i used slices with named lists in yr dd example? 23:24
ab5tract m: my @az = ‘a’..’z’; dd @az[15..*].join(“~”) 23:27
camelia "p~q~r~s~t~u~v~w~x~y~z"
ab5tract tbrowder: does that help? 23:30
tbrowder hm, i'm getting there...so i need to start with a fully defined list. that may be my problem...
ab5tract in order for join to work, there would need to be an endpoint indeed 23:31
But you can still slice an infinite list
You just can’t use infinity as an endpoint of said slice :) 23:32
Also keep in mind that you can pass callables as range endpoints
m: my @az = ‘a’..’z’; dd @az[(*-15)..*].join(“~”) 23:33
camelia "l~m~n~o~p~q~r~s~t~u~v~w~x~y~z"
ab5tract That won’t help much with a lazy or infinite list, but it’s still good to keep in mind 23:34
tbrowder ab5tract: ok, i have it now...stupid errs, thank you so much, 23:35
timo: thanks!
nite...
ab5tract Glad to be you unblocked 23:40
timo maybe you have some use for methods like skip, head, and tail? 23:41