🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
00:05 Skarsnik left 00:06 Skarsnik joined 00:07 reportable6 left 00:46 lichtkind left 00:49 [Coke]_ joined 00:52 [Coke] left 00:57 tellable6 joined 00:58 nativecallable6 joined, benchable6 joined 00:59 evalable6 joined 01:07 reportable6 joined 01:15 Sgeo_ left 01:16 Sgeo_ joined 01:17 silug left, silug joined 01:18 discord-raku-bot left, discord-raku-bot joined 01:23 discord-raku-bot left, discord-raku-bot joined 01:35 epony joined 01:56 shareable6 joined 02:09 hasrthur joined 02:14 hasrthur left, discord-raku-bot left, discord-raku-bot joined 02:21 mahafyi left 02:28 Xliff left 02:29 Sgeo__ joined 02:32 Sgeo_ left 02:51 jrobi joined 02:52 jrobi left 03:01 frost joined 03:03 frost left 03:13 Garbanzo_ joined 03:28 mahafyi joined 03:56 statisfiable6 joined 03:57 bloatable6 joined
elcaro Hrm... Just got bit by the fact that `[R-] (...)` is not the same as `(...).reduce(* R- *)` 04:04
using it in a reduction metaop process the list in reverse. can't seem to find this documented
in fact, documentation on R seems hard to lookup in general. only found docs.raku.org/language/operators#R..._operators 04:05
applies to produce/triangular redunction too... 04:06
m: say ([\R~] <a b c>; <a b c>.produce(* R~ *));
camelia ((c cb cba) (a ba cba))
04:57 linkable6 left, evalable6 left 05:57 bloatable6 left, releasable6 left, notable6 left, coverable6 left, sourceable6 left, benchable6 left, committable6 left, nativecallable6 left, greppable6 left, squashable6 left, bisectable6 left, reportable6 left, tellable6 left, statisfiable6 left, shareable6 left, quotable6 left, unicodable6 left, quotable6 joined 05:58 bloatable6 joined, reportable6 joined, benchable6 joined, tellable6 joined 05:59 evalable6 joined, committable6 joined, bisectable6 joined, squashable6 joined 06:00 unicodable6 joined, statisfiable6 joined 06:07 reportable6 left 06:16 andinus joined 06:25 Ekho left 06:28 Garbanzo_ left 06:40 Ekho joined 06:58 nativecallable6 joined 06:59 linkable6 joined, shareable6 joined, notable6 joined, releasable6 joined, sourceable6 joined 07:00 greppable6 joined 07:20 abraxxa joined 07:26 abraxxa left 07:28 abraxxa joined 07:33 abraxxa left 07:34 abraxxa joined 07:35 ychaouche joined 07:45 squashable6 left 07:53 lichtkind joined 07:57 coverable6 joined 08:08 reportable6 joined 08:11 hasrthur joined, Sgeo__ left 08:12 japhb left 08:15 hasrthur left 08:34 japhb joined 08:38 frost joined 08:42 frost left 08:47 squashable6 joined 08:50 jjido joined 08:58 hasrthur joined 09:09 dakkar joined 09:24 jjido left 09:27 jjido joined
Nemokosch the part you linked: 09:50
_Any infix operator may be called with its two arguments reversed by prefixing with R. **Associativity of operands is reversed as well.**_
for me, this automatically implies that the `[R-] (...)` behavior was valid 09:51
SmokeMachine patrickb: Please, when possible take a look at github.com/FCO/Red/issues/537 09:54
10:00 mahafyi left 10:02 lichtkind left
Nemokosch So yeah, the difference is that R- is right-associative while * R- * is left-associative by default, I guess 10:04
okay, this still doesn't explain: 10:06
mm: dd (1,4,5,10).reduce(&infix:<R->)
m: dd (1,4,5,10).reduce(&infix:<R->)
which is sadly still 8
_If &with is the code object of an operator, its inherent identity value and associativity is respected - in other words, (VAL1, VAL2, VAL3).reduce(&infix:<OP>) is the same as VAL1 OP VAL2 OP VAL3 even for operators which aren't left-associative:_ 10:08
this is not true
```perl
> (1,4,5,10).reduce(&infix:<R->)
8
> 1 R- 4 R- 5 R- 10
0
```
Is this a bug?
10:11 ugexe left 10:12 jcallen left, GreaseMonkey left, mtj left
elcaro I think the difference boils down to the .reduce or .produce methods process 2 args at a time, regardless of the associativity of the operator. The meta-reduction can consider the op before it processes the list, tho this means it can handle infinite seq's 10:12
10:12 jjido left
elcaro m: say ([\R*] (1 .. Inf)).head(3); 10:12
camelia WARNING: unhandled Failure detected in DESTROY. If you meant to ignore it, you can mark it as handled by calling .Bool, .so, .not, or .defined methods. The Failure was:
Cannot .elems a lazy list onto a List
in block <unit> at <tmp> line 1

T…
10:13 greaser|q joined, jcallen joined
Nemokosch I mean, take a look at the quote 10:14
it does suggest that the two "queries" should produce (or reduce, hahaha) the same result
10:15 abraxxa left, andinus` joined, andinus left 10:16 dakkar left
elcaro I don't have time to dig into it now... but I assume this behaivior was chosen purposefully. Maybe it was chosen to mirror Haskell's `foldr` and `foldl` 10:16
Nemokosch _Whether reduce accumulates the elements starting from the left or from the right depends on the operator. In the functional programming world, this operation is generally called a fold. With a right-associative operator it is a right fold, otherwise (and usually) it is a left fold. In Raku, you can specify the associativity of an operator with the is assoc._ 10:17
10:18 dakkar joined
So yes, I don't know the exact definition either but trust me, this is worth reporting 10:18
The behavior explicitly contradicts the documentation so it's either wrong or the documentation needs extra explanation as to why the current description doesn't apply to this scenario 10:20
elcaro bisectable6: say [R-] 1,3,5,10 10:21
bisectable6 elcaro, Will bisect the whole range automagically because no endpoints were provided, hang tight
elcaro, ¦6c (60 commits): «1␤»
elcaro, Nothing to bisect!
10:22 jjido joined
elcaro it's always been that way... so probably just needs doc update 10:22
10:24 mtj joined 10:25 ugexe joined
Nemokosch I mean, [R-] _is right_ 10:29
see "Any infix operator may be called with its two arguments reversed by prefixing with R. Associativity of operands is reversed as well."
10:30 abraxxa joined
(1,3,5,10).reduce(infix:<R->) is wrong 10:30
One could say it's wrong for the sole reason that it isn't the same as [R-] but anyway, that's the one that contradicts the docs 10:31
10:32 jjido left
elcaro The associativy is swapped, which is why the meta-reduction does what it does... but .reduce lazily processes 2 args at a time, so it can't possibly to a right-fold 10:36
`(1,3,5,10).reduce(&infix:<R->)` essentially expands to `(((1 R- 3) R- 5) R- 10)`
Nemokosch Come on, I have quoted the docs several times by now 10:37
it explicitly states that the reduce method does take associativity into account, it expands without "parentheses" and it plays the role of foldl AND foldl, depending on the operator
this is a serious enough contradiction to ".reduce lazily processes 2 args at a time, so it can't possibly to a right-fold" 10:39
and indeed, why should/would List.reduce be lazy?
Supply.reduce okay but List.reduce doesn't have to and it has no particularly good reason to
elcaro yeah, WRT laziness, it's more applicable to .produce 10:42
but yes, I can see the docs, particularly the section you copied starting with _Whether reduce accumulates the elements starting from the left or from_
but it never shows examples of this working with .reduce method, only the meta-reduction 10:43
10:46 mexen_ joined, mexen left, m_athias left, Arathorn left, charsbar left, mexen_ is now known as mexen, Juerd left 10:47 synthmeat left, m_athias joined
elcaro bisectable6: say (1,3,5,10).reduce(&infix:<R->) 10:48
bisectable6 elcaro, Will bisect the whole range automagically because no endpoints were provided, hang tight
10:48 Juerd joined 10:49 Juerd joined
bisectable6 elcaro, ¦6c (60 commits): «7␤» 10:49
elcaro, Nothing to bisect!
10:51 charsbar joined, dakkar left, dakkar joined
Voldenet Can I somehow call methods on hashes to get its keys? 10:51
m: role X { method ACCEPTS($_) { $_.x ~~ $.x } }; class A is X { has $.x; }; say A.new(:5x) ~~ {:5x} but X 10:52
camelia No such method 'x' for invocant of type 'Hash+{X}'
in method ACCEPTS at <tmp> line 1
in block <unit> at <tmp> line 1
Nemokosch there is the keys method, right?
or what do you mean?
elcaro: anyway, I'd say let's not forget this phenomenon because 1. I can still imagine it's a bug 2. if it's no bug, it would be good to get an explanation and add it to the docs 10:53
Voldenet to somehow do this `({:5x} but Magic).x` 10:54
elcaro I will first see if I can find any artifacts in the IRC logs, as well as any existing issues 10:57
10:57 hasrthur left, hasrthur joined 10:59 Arathorn joined 11:00 synthmeat joined
MasterDuke m: role X { method FALLBACK(Hash:D: $key) { self{$key} } }; say ({:5x} but X).x   # Voldenet like this? 11:02
camelia 5
Voldenet Yes, exactly! MasterDuke++ 11:03
Nemokosch what is "but" actually? 11:04
Voldenet operator creating value with mixin
elcaro `but` mixes a role in at runtime (as opposed to `class Foo does Bar` which mixes the `Bar` role in at compiletime) 11:11
11:15 mahafyi joined
leont I'm dd()ing an array, but I'm getting a «Cannot .elems a lazy list onto a Array» error and I don't understand why 11:26
It shouldn't be lazy AFAICT 11:27
11:31 jjido joined
elcaro leont: Array's can still house lazy Seq's. What's you're array look like 11:33
m: my @a = (1..Inf); say 'no eagerness here'
camelia no eagerness here
11:33 unclechu left, AlexDaniel left, anight[m] left, andrea[m] left, CIAvash left, Arathorn left
leont I know they can, but I'm surprised this is 11:35
11:36 hasrthur_ joined
leont It's a Never mind. I accidentally used an X where I meant a Z, and then everything exploded 11:37
11:37 hasrthur left 11:41 CIAvash joined 11:47 CIAvash left 11:51 jjido left 12:01 CIAvash joined 12:02 hasrthur_ left, CIAvash left 12:06 reportable6 left 12:08 CIAvash joined 12:33 [Coke]_ is now known as [Coke] 12:36 CIAvash left 12:40 AlexDaniel joined, Arathorn joined, unclechu joined, andrea[m] joined, anight[m] joined 13:07 Averna joined, reportable6 joined 13:16 jjido joined 13:23 Darkcoal joined 13:31 jgaz joined, m6502 joined, m6502 left, jgaz left, jgaz joined 13:33 Darkcoal left 13:35 Darkcoal joined 13:43 jjido left 13:45 lichtkind joined 13:49 Darkcoal left 13:51 Darkcoal joined 13:53 jgaz left 13:57 jjido joined 14:14 mahafyi left 14:21 mahafyi joined 14:26 SqrtNegInf joined
lizmat clickbaits rakudoweekly.blog/2022/01/31/2022-05-foo-is-42/ 14:28
14:28 CIAvash joined 14:54 jjido left 15:33 Sgeo joined 15:36 D5n9sMatrix joined 15:43 linkable6 left 15:45 qorg11 left 15:46 linkable6 joined 15:49 qorg11 joined 15:50 linkable6 left 15:52 linkable6 joined 15:59 D5n9sMatrix left 16:13 ychaouche left 16:16 swaggboi left 16:21 swaggboi joined 16:49 jjido joined 17:13 Averna left 17:15 Sgeo_ joined 17:19 Sgeo left
Geth doc: b10615679b | (Suman Khanal)++ (committed using GitHub Web editor) | doc/Language/py-nutshell.pod6
Update python to raku

As we know python 2 is no longer maintained www.python.org/doc/sunset-python-2/, its better to reflect examples compatible with python 3 unless we mean python 2 explicitly. This patch makes python examples compatible with python 3.
17:41
linkable6 Link: docs.raku.org/language/py-nutshell
17:41 dakkar left 17:53 abraxxa left 18:07 reportable6 left 18:10 reportable6 joined 18:31 dextercd joined 18:37 mahafyi left 18:38 mahafyi joined 18:39 jjido left 18:42 jjido joined 18:58 ajr joined
Geth doc/circleci: 06b41720f4 | sumanstats++ | 2 files
Remove .circleci folder

Seems like circleci link is dead. As the github action is good, there's no need to keep circleci. Remove.
19:20
doc/circleci: e7ab97e363 | sumanstats++ | README.md
remove circleci from README
doc/circleci: 949e2f2f0b | sumanstats++ | shippable.yml
Remove shippable yml

Doesn't seem to be of use. Remove
doc: sumanstats++ created pull request #4024:
Remove unnecessary files and links
19:23
19:33 clarjon_1 joined 19:35 clarjon1 left 19:36 ajr left
Geth doc: 0eadc5a489 | (Daniel Sockwell)++ (committed using GitHub Web editor) | doc/Language/objects.pod6
Document `handles(**)` (#4019)

Explains that you can pass a HyperWhatever to the `handles` method and describes how that's different from passing a Whatever.
19:42
linkable6 Link: docs.raku.org/language/objects
19:42 linkable6 left 19:43 greaser|q left, greaser|q joined, greaser|q is now known as GreaseMonkey 19:54 ajr joined 19:58 ajr left
Nemokosch lizmat: do you by any chance know something about the strange behavior of List.reduce with infix:<R-> ? 20:11
that is, not taking right-associativity into account (unlike [R-])
lizmat nope
Nemokosch Perhaps it's issue-worthy then? 20:15
Geth doc/circleci: fd77a5e37c | sumanstats++ | 2 files
Revert "Remove .circleci folder"

This reverts commit 06b41720f41b002f1575b20ced338b3b73fbe1c6. CircleCI builds documentation. So keep it.
20:22
doc/circleci: 51d2f935f8 | sumanstats++ | README.md
Revert "remove circleci from README"

This reverts commit e7ab97e36374c986f4bca913cb666ace9c0ba1de.
lizmat probably :-)
20:27 Sgeo joined 20:30 Sgeo_ left 20:40 ajr joined 20:43 chronon left 20:44 linkable6 joined 20:57 Kaiepi left 21:04 jjido left 21:06 Darkcoal left 21:09 Sgeo_ joined, Sgeo left 21:10 jjido joined
Nemokosch to which repository? 21:28
21:29 Sgeo joined 21:31 Sgeo_ left 21:58 vrurg left, vrurg joined 22:03 Kaiepi joined 22:12 jjido left 22:31 dextercd left 22:39 ajr left
SqrtNegInf h 22:46
22:46 SqrtNegInf left
[Coke] i 23:01
MasterDuke j 23:03
23:03 ajr joined
japhb I am now hearing www.youtube.com/watch?v=i0r8egBvWRM in my head 23:05
23:09 ajr left
MasterDuke heh, i'd never heard that one before 23:16
23:20 djerius left 23:21 djerius joined 23:36 ajr joined 23:41 ajr left