On Fri, Sep 27, 2002 at 06:35:49PM +0900, nobu.nokada / softhome.net wrote:
> Hi,
> 
> At Fri, 27 Sep 2002 07:00:11 +0900,
> Mauricio =?unknown-8bit?Q?Fern=E1ndez?= wrote:
> > One foolish way I can think of would be the following:
> > 
> > def do_foo<sort,bar>(b)
> > # used when b can respond to sort and bar
> > end
> > 
> > def do_foo<each>(b)
> > # when it has method each
> > end
> 
> What about this? ;)
> 
> def do_foo(b {b.respond_to?(:sort) && b.respond_to?(:bar)})
> end

A lighter way to express that is needed, and that's why I think this
kind of overloading is only syntactic sugar :-)

-- 
 _           _                             
| |__   __ _| |_ ___ _ __ ___   __ _ _ __  
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ 
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
	Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com
  
(It is an old Debian tradition to leave at least twice a year ...)
	-- Sven Rudolph