🦋 Welcome to the IRC channel of the core developers of the Raku Programming Language (raku.org #rakulang). This channel is logged for the purpose of history keeping about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Logs available at irclogs.raku.org/raku-dev/live.html | For MoarVM see #moarvm
Set by lizmat on 8 June 2022.
Geth rakudo/main: ba7f659c58 | (Elizabeth Mattijsen)++ | src/core.c/RakuAST/Fixups.pm6
RakuAST: don't use named subs for .map/.grep/.first

Nudged by gfldex++
08:51
gfldex lizmat: While we are at the subject of nudging. I do like .visit-children, but I don't like its name and interface. How about `method gather-children(&taker, :$deep)` ? 10:03
lizmat how about .grep ?
that's already in HEAD
as is .map and .first on RakuAST Nodes 10:04
and a dynamic variable @*LINEAGE that shows all of the ancestry
gfldex I would not expect `.grep` to require a `take`.
lizmat it doesn't 10:05
the .map / .grep / first embed the gather and let the map / grep / first logic do the take
your code just needs to return True/False (in the case of .grep / .first) or the value that you want produced (in the case of .map_ 10:06
gfldex Is there a way to introspect if a Code sports CX::Take? 10:07
lizmat $*CU.map: { .paragraphs.Str if $_ ~~ RakuAST::Doc::Block } would produce all the text from doc blocks
gfldex: you mean, whether there's a 'take' inside? 10:08
gfldex yes 10:09
lizmat something like: 10:10
$*CU.grep: { $_ ~~ RakuAST::Blockoid && .first({ $_ ~~ RakuAST::Call::Name && .name eq 'take' }) } 10:12
gfldex Also, a :$deep flag could indicate that I want .grep/.map/.first to decent into children. 10:13
lizmat yeah, I've been considering something like that, just contemplating the name 10:15
perhaps :depth-first ? 10:24
gfldex `multi method grep(&matcher, :$breadth = True, :$gather = False) {}; multi method grep(&matcher, :$depth = True, :$gather = False) {}; method gather(&taker, *%_) { self.grep(&taker, :gather, |%_) }` 10:43
lizmat: maybe like this ^^^
lizmat what would that bring over the functionality that is already in .map/.grep/.first in HEAD (apart from a :depth-first argument that I'm currently testing 10:46
)
?
Geth rakudo/main: 8099dd3c00 | (Elizabeth Mattijsen)++ | src/core.c/RakuAST/Fixups.pm6
RakuAST: add :depth-first argument to .map/.grep/.first
10:53
lizmat meh just found out that my test result checker didn't catch a regression
213bacbb14fa6b6ca5f7d109e7713dcc802a82fc broke it, so only since 16:00 yesterday *phew* 11:36
Geth rakudo/main: 1fd990fb01 | (Elizabeth Mattijsen)++ | src/Raku/ast/doc-block.rakumod
RakuAST: don't let ::Doc::Block descend into ::Doc::Blocks

To fix an issue with production of $=pod that was introduced with 213bacbb14fa6b6ca5f7d109e7713dcc802a82fc . Still not sure whether this is the correct solution, as this feels icky. But it will unbreak the spectests that were broken for now.
11:59
leont lizmat: If I understand your code correctly, it doesn't make a breadth-first/depth-first distinction, but a pre-order/post-order one 12:22
lizmat with depth-first, it first visits all of the children before handling the invocant 12:39
that's going deep first, is it not ?
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2023/05/29/2023-...t-rolling/ 13:23
Geth rakudo/main: 6325d10f41 | (Elizabeth Mattijsen)++ | src/Raku/ast/variable-declaration.rakumod
RakUAST: remove some dead code

The check whether it was initialized, is not necessary anymore. And also if it was not initialized, it would have bombed as the indicated method does not exist.
14:28
leont lizmat: I used to think so too, but apparently not. See en.wikipedia.org/wiki/Depth-first_...rst_search 16:14
Geth rakudo/main: a78234e1c0 | (Elizabeth Mattijsen)++ | 5 files
RakuAST: add support for $=data as described in S26

With RakuAST this became almost trivial to implement, so I did.
This also adds a Pod::Data class, that works both as an Array as well as a Hash. Perhaps this functionality should be made more general, e.g. as a HashArray or Hashray class?
16:32
lizmat leont: well, I don't see a way to provide a different functionality than now offered with :depth-first, other than controlling the calling of .visit-children yourself 16:34
leont I don't mean to suggest it's doing the wrong thing, it's just using an incorrect name for the right thing. 16:38
lizmat ok, so depth-first should be called pre-ordered ? 16:39
Geth nqp/main: 4f0c01f7ce | (Elizabeth Mattijsen)++ | tools/templates/MOAR_REVISION
Bump MoarVM to get timo++'s optimization
16:41
leont No, post-order 16:42
Geth rakudo/main: 13b9a6bcd8 | (Elizabeth Mattijsen)++ | tools/templates/NQP_REVISION
Bump NQP to get timo++'s latest MoarVM updates
16:58
rakudo/main: 65dc1204f2 | (Elizabeth Mattijsen)++ | src/Raku/ast/doc-block.rakumod
RakuAST: must keep =data entries in $=pod

To remain compatible with any code that expects to lift =data sections out of $=pod
17:07