On Fri, Apr 23, 2004 at 01:15:51PM -0400, Austin Hastings wrote:
: A12 sez:
: 
:   If your delegation object happens to be an array:
: 
:     has @:handlers handles 'foo';
: 
:   then something cool happens. <cool rays> In this case
:   Perl 6 assumes that your array contains a list of potential
:   handlers, and you just want to call the first one that
:   succeeds.
: 
: This is not clear, and I'm not liking it at the moment anyway. It has the
: effect of saying:
: 
: "If you HAS-A attribute that is an array, you cannot delegate to it, but if
: you IS-A array, no worries."
: 
: So Queue classes that start out:
: 
:   class Queue is Array {...}
: 
: can get push/pop/splice whatever methods for free, but:
: 
:   class Queue is PersistentObject
:   {
:     has @:elements handles «push pop splice»;
: 
: can not work (unless one of the things inside @:elements happens to be an
: array).

    has $:elements handles «push pop splice»;

can hold an array in that case.

: Also, it's not clear:
: 
:   "first one that succeeds"
: 
: Does that mean "First one for which a matching method exists" or does it
: mean "First one for which a method exists that does not C<fail> or return
: undef or some other badness"?

The latter is the intent.

Larry

Reply via email to