Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created July 10, 2011 16:03
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 jnthn/1074649 to your computer and use it in GitHub Desktop.
Save jnthn/1074649 to your computer and use it in GitHub Desktop.
method scalar_wrap($obj) {
my $scalar_type := self.find_symbol(['Scalar']);
my $scalar := nqp::create($scalar_type);
my $slot := self.add_object($scalar);
nqp::bindattr($scalar, $scalar_type, '$!value', $obj);
# XXX we do deserialization later...
$scalar;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment