This post originated from an RSS feed registered with Ruby Buzz
by Jeremy Voorhis.
Original Post: Aliasing Global Variables in Ruby
Feed Title: JVoorhis
Feed URL: http://feeds.feedburner.com/jvoorhis
Feed Description: JVoorhis is a Rubyist in northeast Ohio. He rambles about Ruby on Rails, development practices, other frameworks such as Django, and on other days he is just full of snark.
And while I am becoming quite the language lawyer, I should mention that Ruby’s alias statement treats global variables quite differently from other kinds of variables.
When aliasing global symbols, the global variable itself is aliased and not evaluated. The result is a true alias, not a copy, so you cannot modify the global and its alias independently.
This feature most likely exists solely for English.rb in the standard library. This being the case, see that file for examples.