Hi --

On Mon, 15 Dec 2003, Gregory Millam wrote:

> 
> > def announce(args)
> > 	parameters(args,:age=>21)
> > 	"My name is #{first} #{last} and my age is #{age}"
> > end
> > 
> > announce(:first=>'John', :last=>'Smith') generates
> > "My name is John Smith and my age is 21"
> 
> You can use:
> 
> args.each { |key,val| eval "#{key}=#{val}" }

The variables you create that way will only be in scope in the
eval block itself:

  eval "a = 1; puts a"   # 1
  puts a                 # error: a is undefined


David

-- 
David A. Black
dblack / wobblini.net