itsme213 wrote:

> Looks like it uses eval, which only takes a string, so I'm not sure ... Do
> you think it could implement bind_vars to do the following?
> 
> def f (arr)
>     bind_vars [:x, :y, :z], arr
>     [x, y, z]
> end

Mostly. But you would need to initialize the variables x, y and z to nil 
so that Ruby actually sees them as variables and not method calls.

It would work like this:

def bind_vars(names, values)
   Binding.of_caller do |context|
     setter = eval("lambda { |#{names.join(", ")}| }", context)
     setter.call(*values)
   end
end