----- Original Message ----- 
From: Joseph McDonald <joe / vpop.net>
To: ruby-talk ML <ruby-talk / ruby-lang.org>
Sent: Monday, October 22, 2001 2:42 PM
Subject: [ruby-talk:22992] Re: assigning variables


> 
> HEF> I don't get *why* you want to do this... could you
> HEF> just use an array of arrays?
> 
> It's for a templating type application.  I want to be able to name the
> variables that go in.  I just used arrays as an example.  I'd like to
> be able to pass any sort of object in, along with the name that object
> will be referenced as.

Could you possibly just keep it as a hash?
Not refer to a and b but vars["a"] and vars["b"]?

One problem, I think, is that eval can't create a
new local variable. (It can, but only within the 
context of the eval -- it won't be defined when 
you return.)

Would it be practical to make these instance
variables, i.e., @a, @b, etc.? Or, heaven help us,
globals?

Hal