Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

when calling sets of methods, what happens to the return values?

5 views
Skip to first unread message

Mark Stosberg

unread,
Sep 2, 2006, 11:26:10 PM9/2/06
to perl6-l...@perl.org
S12 describes a feature to call sets of methods at the same time:

http://feather.perl6.nl/syn/S12.html#Calling_sets_of_methods

I would like the spec to clarify what happens to the return values of
all these methods.

I'm fine with a simple answer, such as that they are not available, or
only the first or last set of return values is returned.

As a "use case", we may use of basically this feature in
CGI::Application in Perl5, as part the plugin system. Each plugin
location is like a method name, and as we get to each point in the code,
we look up through the inheritance tree, executing methods at each location.

In this case, I think we ignore the return values.

Mark

Mark Stosberg

unread,
Sep 4, 2006, 9:34:40 AM9/4/06
to perl6-l...@perl.org

So, Audrey implemented the beginning of this functionality:

$obj.*$meth, for single inheritance.

As part that she implemented return values. Her design was to compose
the final return value as an unconcatenated list of each method's return
value.

Example:

If C.foo returns (1,2,3) and D.foo returns(4,5,6)
you get
$obj.*$meth.[0][0] == 1
$obj.*$meth.[1][0] == 4

That works OK for me. If there's a downside, if there is a downside,
it's that it could be hard to track down where a mysterious return value
came from, since the return value object doesn't tell you exactly which
methods were called, and in which order.

Mark

0 new messages