Skip to content

Instantly share code, notes, and snippets.

@j1n3l0
Created March 13, 2009 00:20
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 j1n3l0/78373 to your computer and use it in GitHub Desktop.
Save j1n3l0/78373 to your computer and use it in GitHub Desktop.
# How does one CAST from a Str to an Int in rakudo?
# This is an example going from an Int to a Str ...
multi sub f($x is rw) {
say 'before ' ~ $x ~ ' = ' ~ $x.WHAT;
$x = ~$x;
say 'after ' ~ $x ~ ' = ' ~ $x.WHAT;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment