I went to [bart.gooogle.com] and asked it: "How do you write lambda functions in Raku?"
Here's how it responded:
===
To write lambda functions in Raku, you can use the following syntax:
Code snippet
I went to [bart.gooogle.com] and asked it: "How do you write lambda functions in Raku?"
Here's how it responded:
===
To write lambda functions in Raku, you can use the following syntax:
Code snippet
raku -Ilib -e 'use experimental :rakuast; use MONKEY-SEE-NO-EVAL; my $ast = RakuAST::Statement::Need.new( module-names => [ RakuAST::Name.from-identifier(RakuAST::Name.from-identifier("GLib::Raw::Definitions")) ] ); EVAL $ast; import ::("GLib::Raw::Definitions"); glib.say'
This is the exact testing data. It's execution ready if you clone p6-GLib, you should
only need to change into the project directory and run the above. Otherwise you will have to create a .rakumod file
with a constant declaration and replace the glib
in the above script with the name of that constant.
So I needed to access the symbol table of one of my modules, recently. After a few hours on the web (and after wracking my brain for a bit) I came up with the following:
sub getSymbolTable (\T, $cu-name) is export {
return Nil unless $cu-name;
my $nodes = $cu-name.split('::').Array;
my $fn = $nodes.shift;
my $st = T.WHO{$fn};
Does anyone see a problem with this? If so, I will submit the PR.
diff --git a/src/core.c/RakuAST/Deparse.pm6 b/src/core.c/RakuAST/Deparse.pm6
index ef073dbba..62410a414 100644
--- a/src/core.c/RakuAST/Deparse.pm6
+++ b/src/core.c/RakuAST/Deparse.pm6
@@ -619,6 +619,9 @@ class RakuAST::Deparse {
my $target := $ast.target;
Version 0.0.2 - Now includes attributes!
RakuAST::ApplyDottyInfix - (ast/expressions.rakumod - 923)
Attributes
RakuAST::DottyInfixish $.infix
RakuAST::Expression $.left
RakuAST::Postfixish $.right
Here's something I wrote for guifa a couple of days ago. I am thinking of turning it into a simple Rakuish event loop for my projects.
Is this a fairly decent implementation, or is this just NIH for cron?
Please share your thoughts.
my %suppliers;
Have I told you how wonderful I think Raku is?
Well I don't have enough words to do that.
However even the best languages have thier faults, and one of Raku's the following:
sub a ( :name(:named(:$names)) ) { ... }
So I was looking through what I have written for $dayJob, as far as my work with a Cro-based application server is concerned.
It occurred to me that we might be able to clean up what is already a fairly clean Cro dispatch handler.
Consider this example:
route {
get -> { ... }
get -> '2' { ... }