Skip to content

@avdi /alias.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Aliasing global variables in Ruby
$magic_word = "xyzzy"
alias $mw $magic_word
$mw = "please"
$mw # => "please"
$magic_word # => "please"
@avdi
Owner

Note that assigning to the alias changes the original. This is what makes the English stdlib possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.