Reading about capture objects, I see that they represent an arglist, and the the object to which you going to send those args. What is doesn't capture is the method name (the verb) that's being called. This feels like a slightly strange ommission.

Compare:

  $message = &Shape::draw.prebind( x=>0, y=>0 );
  $capture = \( $shape: x=>0, y=>0 );

  $shape.$message;
  draw *$capture;

These are both doing very similar things. The difference is only in the thing that's being associated with the arglist. In the case of currying it's the method whereas for the capture it's the invocant.

Perhaps I'm not fully groking the abstraction of the capture-object, but it seems to me that there should be a slot in it for the method. For dispatch, all three things are needed (invocant, method, args); so if you're going to put two of them in one object, then maybe the third thing belongs, too.

Reply via email to