From: Daniel Schierbeck Date: 2006-05-28T20:25:51+09:00 Subject: Re: Crazy thought -- Rubyish type conversion? Okay, I've implemented it slightly different: require 'facet/binding' def args_to(types = {}) Binding.of_caller do |binding| types.to_hash.each do |arg, type| binding[arg] = binding[arg].send("to_#{type}") end end end def test(foo, bar, baz) args_to :foo => :sym, :baz => :s return foo, bar, baz end p test("foo", "bar", 42) #=> [:foo, "bar", "42"] Daniel