🦋 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.
00:00 reportable6 left 00:02 reportable6 joined
MasterDuke hm. i got t/spec/S32-num/pi.t and t/spec/S32-trig/e.t passing under RAKUDO_RAKUAST=1, but 9 other tests are now failing when they used to pass...i knew this 4 line fix was too good to be true... 01:50
timo1: cool. i've never driven an opel before (unless gran tourismo counts), but i got a polestar 2 when we moved back to the states. the acceleration is fun 01:55
02:19 sivoais left 03:16 jacob_c joined 03:19 sivoais joined 04:38 jacob_c left 04:44 discord-raku-bot left 04:46 discord-raku-bot joined 04:47 shmup left, shmup joined 06:00 reportable6 left, reportable6 joined
nine MasterDuke: that happens to me all the time :) 08:22
timo1 this opel corsa was extremely cheap thanks to government-given subsidies and also some extra bonus from the manufacturer on top of that 10:28
we felt some time pressure since the government-given subsidies were supposed to run out soon (counting the time it takes for the car to arrive, which was "months" already just by default, and turned out to be even more months in our particular case due to $reasons), so i didn't get to wish for the fanciest features, but it's got a good set 10:30
it's got the "even if your battery burst into flames and the electronics shut off you can still escape" technology called "hand-cranked windows on the back seats" for instance 10:31
i don't think it has the "vehicle to load" functionality that i just saw Technology Connections Man demonstrate 10:33
10:38 linkable6 left, evalable6 left 10:40 evalable6 joined 10:41 linkable6 joined
Geth rakudo/main: fa384e232e | (Elizabeth Mattijsen)++ | src/Raku/Actions.nqp
RakuAST: make {*} an OnlyStar

And not just a statementlist with a Whatever in it
Nemokosch 🤯 10:51
lizmat nine: I think all of the VarDeclaration::Placeholder classes need an additional argument to their .new: the block to which they apply 11:04
otherwise there's no way to deparse / .raku an AST properly without EVALling them 11:05
as the attachment to the block is now done at CHECK time 11:06
also, we need to add checks in the Actions to make 11:07
sub ($a) { $^pos }
m: sub ($a) { $^pos }
camelia ===SORRY!=== Error while compiling <tmp>
Placeholder variable '$^pos' cannot override existing signature
at <tmp>:1
------> sub⏏ ($a) { $^pos }
lizmat a compile time error (it currently isn't
m: say Q|sub foo ($a) { $^pos }; foo 42|.AST(:run) # very confusing 11:08
camelia 42
lizmat which could be done with an extra :block attribute to RakuAST::VarDeclaration::Placeholder ? 11:11
thoughts? 11:12
in the Actions, $*BLOCK already contains the needed Block
11:17 ab5tract joined
lizmat hmmm... maybe there are 2 things here: 1. making sure we get the right compilation error 11:18
and 2. making sure manual building of ASTs is checked properly 11:19
ab5tract from the backlog: "nine: should a RakuAST::Declaration::External::Constant be considered a type ??" 11:35
I used RakuAST::Declaration::External::Constant for both RakuAST::Type::Enum and RakuAST::Type::Subset 11:36
Because it had the correct QAST
but maybe the point is that some types can be designed using RakuAST::Declaration::External::Constant but you cannot assume a RakuAST::Declaration::External::Constant is a type 11:37
lizmat I think I got to that conclusion also :-) 11:38
ab5tract okay, phew
lizmat so what is the class common to Block / Sub / Method / etc? 11:39
basically, anything that can have a signature
for a momen I thought it would be RakuAST::ExpressionThunk 11:41
but I'm looking for the ones that have an *explicit* signature
hmmm.. maybe RakuAST::PlaceholderParameterOwner ? 11:42
ab5tract sounds like it would be a common role 11:48
amongst those classes that you are looking for
lizmat well, I'm looking for a way to add a method to this common role, that would visit the children and return whether any of the children has RakuAST::VarDeclaration::Placeholder object 11:49
* 11:50
and this at object creation time
ab5tract Hmmm....
lizmat so that *if* the statement list has a placeholder in it, *and* there is an explicit signature, it can fail 11:51
m: say Q|sub ($a) { $^b }|.AST 11:52
camelia RakuAST::StatementList.new(
expression => RakuAST::Sub.new(
signature => RakuAST::Signature.new(
parameters => (
target => RakuAST::Param
lizmat m: say Q|sub ($a) { $^b }|.AST.statements.head.expression
camelia RakuAST::Sub.new(
signature => RakuAST::Signature.new(
parameters => (
target => RakuAST::ParameterTarget::Var.new("\$a")
body => RakuAST::Blockoid.new(
lizmat so that such a manual AST building would fail 11:53
ab5tract if its something that could be useful for other situations, maybe it makes sense to add a way to provide a custom callback to be passed to visit-chldren?
lizmat visit-children already takes a callback? that's the point, no ? 11:54
I'm just unclear about the exact semantics of visit-children: should it recurse itself, or is the recursion handled externally ? 11:55
nine jnthn ^^ ?
ab5tract I was under the impression that visit-children is called in a handful of places that all provide their own callbacks 11:56
I was suggesting to add a way to hook into one of these locations with a custom callback provided by the common role
method has-custom-visit-children { true }; method CUSTOM-VISIT-CHILDREN { &callback } 11:58
but I see what you are saying 11:59
12:00 reportable6 left, reportable6 joined 12:03 NemokoschKiwi joined 12:13 NemokoschKiwi left 13:24 jacob_c joined 13:42 jacob_c left
Geth rakudo/main: 588d0f6ab7 | (Elizabeth Mattijsen)++ | 3 files
RakuAST: add RakuAST::PlaceholderParameterOwner.code-has-placeholders

This method intended for introspection of ASTs, such as happens with deparsing and .raku. It returns True if any placeholder variable is found in the code of the object that is a placeholder parameter owner
  (such as PointyBlock, or any Routine)
rakudo/main: cd21886998 | (Elizabeth Mattijsen)++ | t/12-rakuast/signature.rakutest
RakuAST: remove :EVAL from RakuAST tests

As EVAL is no longer necessary to be able to correctly deparse or provide a .raku representation.
nine visit-children does (and should do) exactly what it says: call that visitor for the node's children. Not more, not less. 15:49
17:04 ab5tract left
lizmat so, this should be a simple loop then, with a return ? 17:05
17:05 ab5tract joined
lizmat ah, no, you mean it's only for that node's children... so doing the recursion in code-has-placeholders is correct 17:06
18:00 reportable6 left 18:01 reportable6 joined
nine yes 18:02
19:06 NemokoschKiwi joined 19:19 NemokoschKiwi left 20:44 ab5tract left