-
-
Save FROGGS/25d22b159f3c225993c1 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
my Mu $sh := nqp::list_s(); | |
my $file = 'TEST_FILE'.IO; | |
unless $file.e { | |
my Mu $sc := nqp::createsc('FLUBBER'); | |
my $obj = { foo => 'bar' }; | |
nqp::scsetobj($sc, 0, $obj); | |
nqp::setobjsc($obj, $sc); | |
$file.IO.spurt: nqp::p6box_s(nqp::serialize($sc, $sh)); | |
} | |
my str $serialized = nqp::unbox_s($file.slurp); | |
my $dsc := nqp::createsc('BLUBBER'); | |
nqp::deserialize($serialized, $dsc, $sh, nqp::list(), nqp::null()); | |
say nqp::scobjcount($dsc); | |
say nqp::scgetobj($dsc, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment