-
-
Save dakkar/1af4796894f695ceee13da925924fa6f 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.d; | |
class A { | |
multi method put-address(Int $addr, Blob $data, :$space = 'SNES') { | |
say "int-blob"; | |
} | |
multi method put-address(**@args, :$space = 'SNES') { | |
my @params; | |
my @datas; | |
for @args -> $arg { | |
say $arg.raku, $arg.WHAT.raku; | |
say "I am a list" if $arg ~~ List; | |
@params.push(($arg[0].base(16), $arg[1].base(16))) if $arg ~~ List; | |
@datas.push($arg) if $arg ~~ Blob; | |
} | |
say @params.raku, @datas.raku; | |
return; | |
} | |
} | |
A.new.put-address((0xF50050, 4), (0xF50054, 2), Buf.new(<1 2 3 4>), Buf.new(<5 6>)); | |
__END__ | |
$ raku x.raku | |
$(16056400, 4)List | |
I am a list | |
$(16056404, 2)List | |
I am a list | |
Buf.new(1,2,3,4)Buf | |
Buf.new(5,6)Buf | |
[("F50050", "4"), ("F50054", "2")][Buf.new(1,2,3,4), Buf.new(5,6)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment