From: nobu.nokada@... Date: 2001-11-29T15:05:08+09:00 Subject: [ruby-talk:26869] Re: overload possible? At Thu, 29 Nov 2001 14:05:00 +0900, Rich Kilmer wrote: > excellent idea...how about this refactoring... Thank you, but it could `overrun' into the next block, if return were lost carelessly? BTW, I think it's better that types are classes themselves not but their names. Also it allows non-exact match. > module Overload > def overload(args, *types) > return if args.length != types.length > args.each_index {|i| return if args[i].type.to_s != types[i].to_s} args.each_index {|i| return unless types[i] === args[i]} > def hello(*args) > overload(args, :Fixnum, :String, :Float) do overload(args, Fixnum, String, Float) do Nobu Nakada