"Joseph McDonald" <joe / vpop.net> wrote:
>
> > However, you might want to think about alternative designs to get the
> > same effect... this is going to get messy pretty quickly :)
>
>Yes.  very messy.  OK, here's another question.  Is it possible
>to get the "name" of a variable that is passed as an argument.
[...]

Your question strangely reminds me of a classic thing you
see in Perl.  People decide that they want to start naming
other variables, pulling things out of them, etc.  In Perl
this is easy to do, but it is a very dangerous practice.

I don't know how to do it in Ruby, nor do I want to find
out.  Rather I suggest that the sane approach is to start
using the keys/values of a hash as variables instead of
messing around with your own variables.

For a complete explanation of why I think this please see
the following explanation of the problem and the issues
it calls in Perl.  Be sure to follow the links to parts 2
and 3.  (Part 3 in particular is one of my favorite
essays on programming philosophy.)

http://perl.plover.com/varvarname.html

I really don't mean to be jumping down your throat here
(though it might look that way), you just happened to set
off a bunch of danger flags.  If the situation is what it
looked like to me, then please read those links and view
this as a lesson learned.  If it is not, then *still*
read those links for general interest and get back saying
that you really wanted something else...

Cheers,
Ben
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com