| 16 Jan 2026 | |||
| tbrowder | ref yml files how can actions be always the same for two diff OSs? | 18:50 | |
| for the github workflows files | 18:53 | ||
| are talking about somethng like the "run-tests" file in repo "Spreadsheet::XLSX"? | 18:57 | ||
| i am obviously missing some point 'cause both lizmat and [Coke] have lost patience with my failure to understand... | 19:04 | ||
| :( | 19:05 | ||
| for instance, each system uses a different cmd to load prereqs (not modules with zef) | 21:02 | ||
| so someone please enlighten me | 22:57 | ||
| 17 Jan 2026 | |||
| disbot11 | <jubilatious1_98524> ~ % raku -e 'my @a = (1,2,3,1,2,3).rotor(3 => -2); say $_, .map( * < * > * ) for @a;' (1 2 3)(False) (2 3 1)(True) (3 1 2)(False) (1 2 3)(False) | 00:18 | |
| <jubilatious1_98524> @librasteve ~ % raku -e '(1,2,3,1,2,3).rotor(3 => -2) andthen say $_>>.map( * < * > * );' ((False) (True) (False) (False)) | 00:19 | ||
| <jubilatious1_98524> @librasteve ~ % raku -e 'my @a = (1,2,3,1,2,3).rotor(3).map(*.rotate); for @a { print "($_) "; .map( * < * > * ).say };' (2 3 1) (True) (2 3 1) (True) | 00:28 | ||
| <librasteve> okay … so this line scans the values to find every local peak in a list of values? | 08:59 | ||
| <librasteve> thanks for the update | 09:02 | ||
| <jubilatious1_98524> @librasteve fine for .weekly, but with the caveat that the .map(* < * > * ) only works for three element lists. Of course, you can reorder the map to check ascending values (or descending values), e.g.: | 17:25 | ||
| <jubilatious1_98524> raku -e 'my @a = (1,2,3,1,2,3).rotor(3 => -2); say $_, .map( * < * < * ) for @a;' (1 2 3)(True) (2 3 1)(False) (3 1 2)(False) (1 2 3)(True) | 17:26 | ||
| <jubilatious1_98524> ~ % raku -e 'my @a = (1,2,3,4,1,2,3,4).rotor(4 => -3); say $_, .map( * < * < * < * ) for @a;' (1 2 3 4)(True) (2 3 4 1)(False) (3 4 1 2)(False) (4 1 2 3)(False) (1 2 3 4)(True) | 17:27 | ||
| <jubilatious1_98524> @librasteve ^ handling a 4-element list. | 17:29 | ||
| 19 Jan 2026 | |||
| librasteve_ | rakudoweekly.blog/2026/01/19/2026-...amentable/ | 18:46 | |
| habere-et-disper | Is there a reason why there appears to not be a unicode equivalent of not-greater-than !> and not-less-than !< ? | 21:23 | |
| m: say 2 ≯ 1 ≮ 0 | 21:36 | ||
| camelia | ===SORRY!=== Error while compiling <tmp> Confused at <tmp>:1 ------> say 2<HERE> ≯ 1 ≮ 0 expecting any of: infix infix stopper postfix statement end statement modifier stateme… |
||
| lizmat | habere-et-disper: !> and !< are really metaops.... the only exception is != afaik.... | 22:20 | |
| also, isn't !> the same as <= ? | |||
| habere-et-disper | There are similar. But as with "if" and "unless" sometimes you want the one or the other. | 23:11 | |
| 22 Jan 2026 | |||
| lizmat | not sure what's going on there.... but it feels like using .substr would make more sense? | 10:28 | |
| or raku.land/zef:lizmat/String::Fields ? | |||
| anyways... I think it's because the last line is incomplete.... and the result of a pack() is a Buf, which you cannot "print" just like that (as print calls .Str, and that Buf.Str bails) | 10:36 | ||
| in the last line, either use "say" or "dd" | |||
| filling out the last line so It properly aligns, and using say or dd, makes that code pass for me | |||
| yes, .gist will do that | 10:45 | ||
| but I don't think that's the issue here... I think the error from unpacking an incomplete line, is the issue here (I guess the error message could use some improvement | |||
| hmmm.. looks like a golf of the issue is: dd unpack("xA*", Buf.new(0)); | 10:53 | ||
| 'x' outside of Buf | 10:54 | ||
| I guess creating an issue is in place :-) | |||
| (as in: someone should do that) | 10:56 | ||
| jgaz | If I `my $cmd = run 'ls', '-l'; say $cmd;` it works in that I get stdout, but I get a bunch of unwanted stuff appended to the end as well. How do I just get STDOUT as a string? | 14:37 | |
| Yes, that worked. The `:out` I mostly follow, but why the `.slurp`? | 14:50 | ||
| Also, thank you. I know it's basic, but it was annoying me and I couldn't make it work. | |||
| Thanks | 15:05 | ||
| 24 Jan 2026 | |||
| deoac | I would like to do a string substitution (not a regex substitution) and learn how many substitutions were made. e.g. `my $s = 'foo'; $s .= subst('o', 'e', :g)` should change `$s` to `fee`. How do I know that 2 substituitons were made? | 10:43 | |
| lizmat | if the replacement string has a different size than the original, you could deduce it from the difference in string sizes of the modified string vs the original string | 10:52 | |
| deoac | That cant be guaranteed. | 10:53 | |
| lizmat | if they're the same... well, then you'd need to do a .match | 10:54 | |
| m: 'say "foobarbaz".match("o", :g).elems | |||
| camelia | ===SORRY!=== Error while compiling <tmp> Unable to parse expression in single quotes; couldn't find final "'" (corresponding starter was at line 1) at <tmp>:1 ------> 'say "foobarbaz".match("o", :g).elems<HERE><EOL> expecting any of: … |
||
| lizmat | m: say "foobarbaz".match("o", :g).elems | ||
| camelia | 2 | ||
| lizmat | or use a Callable as the replacement: | 10:56 | |
| m: my $c; say "foobarbaz".subst("o", { ++$c; "e" }, :g); say $c | |||
| camelia | feebarbaz 2 |
||
| deoac | `match` doesnt change the string. But I like the Callable solution, it's a new tool for me. Thank you. | 10:58 | |
| lizmat | yw | 10:59 | |
| 26 Jan 2026 | |||
| librasteve_ | rakudoweekly.blog/2026/01/26/2026-...o-goodbye/ | 19:15 | |
| 2 Feb 2026 | |||
| rakudoweekly.blog/2026/02/02/2026-...riodicity/ | 08:10 | ||