At 7:30 AM +0000 1/24/03, Piers Cawley wrote:
In my quest to eliminate as many explicit conditionals from my code as
possible, I found myself wondering if Perl 6's multidispatch mechanism
would allow one to write:

   sub gmttime ( $time = time() ) is in_scalar_context {
      strftime( $perls_default_time_format, $time );
   }

   sub gmttime ( $time = time() ) is in_list_context {
      ...
   }

where 'in_scalar_context' and 'in_list_context' are place holders for
better syntax.
There's been some discussion of this, doing MMD based on return type as well as the parameters. It's definitely cool, but IIRC it's potentially a bit of a pain, since context is odd in spots.
--
Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk

Reply via email to