I was trying to demonstrate that a variable, say the unassuming x,
could actually turn out to be a Symbol (even though it is not prefixed
with a colon). However, that is not surprising because:
1. In Ruby one can write
x = :my_symbol
but can't write
:my_symbol = x # This is sort of equivalent to trying to write 5 = x
That is, apart from specifying a Symbol literally (e.g. :my_symbol)
one can only specify a Symbol by specifying the variable that
references it. Like ALL objects in Ruby, to specify the object you
either specify it literally or specify the variable that references
2. Since Ruby is a dynamically typed language a variable, say the
unassuming x again, can reference different classes of objects
throughout a program. As such, a variable could reference any class
of object at a particular moment in time, including a Symbol object.
Apologies if this is not a revelation to the reader.