Skip to content

Instantly share code, notes, and snippets.

@FROGGS

FROGGS/buf8.nqp Secret

Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FROGGS/81b81e4282ae9d426381 to your computer and use it in GitHub Desktop.
Save FROGGS/81b81e4282ae9d426381 to your computer and use it in GitHub Desktop.
my $uint8 := nqp::newtype(NQPNativeHOW.new, 'P6int');
my $info := nqp::hash();
$info<integer> := nqp::hash();
$info<integer><bits> := 8;
$info<integer><unsigned> := 1;
$info<float> := nqp::hash();
$info<float><bits> := 8;
nqp::composetype($uint8, $info);
my $at := nqp::newtype(NQPClassHOW.new, 'VMArray');
nqp::composetype($at, nqp::hash('array', nqp::hash('type', $uint8)));
my $arr := nqp::create($at);
nqp::bindpos_i($arr, 0, 350);
say(nqp::atpos_i($arr, 0)); # 94
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment