Damian Conway wrote:
> Piers Cawley wrote:
> > I really don't like that fine grained syntax I'm afraid. And I'm not
> > entirely sure you actually gain anything from it do you?
> 
> That's one of the questions we're still pondering.


Suppose I wanted to do something like:

   sub draw_triangle( Point $a, Point $b, Point $c );
-and-
   sub draw_triangle( int $x1,$y1, int $x2,$y2, int $x3,$y3 );
-and-
   (every conceivable combination of those damn arguments)


Would the currently-pondered multimethod syntax support anything roughly
analogous to the pseudocode:

   sub draw_triangle(
      ( Point $a | int $x1,$y1 -> Point.new($x1,$y1) ),
      ( Point $b | int $x2,$y2 -> Point.new($x2,$y2) ),
      ( Point $c | int $x3,$y3 -> Point.new($x3,$y3) )
   ) {
      ... stuff using $a, $b, $c ...
   }

such that I don't need 2^3 separate damn prototypes of C<draw_triangle>?

Sorry for this question, but this is one of the Big Ones that's been
bugging me for quite some time.  Frequently (usually?), multimethods are
built such that there is one "true" case, and all other variations are
utterly minor derivations of that case...

MikeL

Reply via email to