On 2008-Aug-9, John M. Dlugosz wrote <http://www.dlugosz.com/Perl6/web/return.html > to clarify and extrapolate from what is written in the Synopses:

Third, list assignment will handle assignment to a literal pair by accessing the names of the items inside the Capture. So list assignment behaves a lot like binding, but doesn’t do everything that parameter passing can do.
[...]
The example seen early on of (:$year,:$mon,:$mday) = localtime(time); can be made to work by returning both positional and named values. The return signature would need to have twice as many items, and the return statement would need to supply each one twice.


Couldn't these all work the same way as parameter passing does? Even at the cost of a bit more complexity, it would be simpler overall to have only one set of rules to learn.



-David


Reply via email to