T
thunk
You're thinking about it the wrong way. A symbol is a pointer to a
specific address in memory, kinda like a variable.
Do you expect this code to work?
a = 5
b = NeuralNetwork.new
puts (a + b).to_s
.. You'll get an error, because a and b are just pointers to the
objects. Symbols are a bit different; while they are "faster" than plain
variables, or than strings, they never get garbage collected (I can not
explain any more than this, but many around here know Ruby's deep magic
well), and they always refer to the same memory space.
I think you're using symbols inappropriately. What -are- you doing with
them? If you need to add two names together, then my guess is, just
stick with strings.
just quickly: they start life as a method name so i was hoping they
could stay symbols - but i need a tie breaker for the one level key
that becomes a simpleton method (name) in this "whiteboard" class. i
keep trying to use all symbols. note: ruby is not fighting me with
the /?!/ - so the door seems open to bite the bullet and convert ->
append -> reconvert but it "hurts" my sense of symmetry - but thanks -
that makes perfect sense (and now that i think about it- it had to be
that way, almost).
thunk