-
-
Save lizmat/7543275e6f56f480fbd8c32b1b9bee6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6.*; | |
multi sub frobnicate ($a) { $a } | |
BEGIN &frobnicate.add_dispatchee: | |
RakuAST::Statement::Expression.new( | |
expression => RakuAST::Sub.new( | |
multiness => "multi", | |
name => RakuAST::Name.from-identifier("frobnicate"), | |
body => RakuAST::Blockoid.new( | |
RakuAST::StatementList.new( | |
RakuAST::Statement::Expression.new( | |
expression => RakuAST::IntLiteral.new(42) | |
) | |
) | |
) | |
) | |
).EVAL; | |
say frobnicate(); | |
say frobnicate(137); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment