New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Named/Positional dispatch confusion #78
Comments
From @teneRakudo currently passes positional arguments into named parameters of sub a (:$a) { say $a } a(1); Possibly related, this also does the wrong thing: multi sub t ($a) { say 'one positional' } t(1); Prints: "one named". |
From @pmichaudOn Wed, May 07, 2008 at 02:12:00AM -0700, Stephen Weeks wrote:
There's a somewhat significant mismatch between Perl 6's handling of My guess at this point is that unless/until Parrot updates its .sub 'a' and then generate code to bind positional/named arguments to
I suspect Parrot's MMD here, and since Parrot MMD is due for an Thanks! Pm |
The RT System itself - Status changed from 'new' to 'open' |
From @teneNot long ago, Patrick R. Michaud via RT proclaimed...
Won't that cause problems with signatures for MMD? |
From @pmichaudOn Wed, May 07, 2008 at 08:11:28AM -0600, Stephen Weeks wrote:
It might. As I said, there's a somewhat significant mismatch, and Another example of a mismatch is that named parameters in Perl 6 sub foo($x, $y) { say "$x $y"; } Each of the below calls to foo produce the same results: foo(1, 2); Note that even though $x and $y are required positional parameters, (We may want to re-think Parrot's calling conventions altogether, Pm |
From @diakoptersub foo($w, $x?, $y?, :$z = 2){ say $w~"|" OUTPUT[1|Failure|Failure|something_extra] the 'something_extra' should have been disregarded entirely. I Note also that pugs gives: OUTPUT[*** No compatible multi variant |
From @diakopter14:12:49 < diakopter> rakudo: sub foo(:$w=4){say $w.perl}; my foo(%z) should be invoking foo with %z as a positional argument, and |
From @pmichaudOn Sun, May 25, 2008 at 10:34:25AM -0700, diakopter wrote:
I would expect 'something_extra' to generate an exception, As far as what is happening with Rakudo above, Also, as far as I can tell "Undef" isn't really a valid type
Pugs does what I would expect -- i.e., complain that it can't Pm |
The RT System itself - Status changed from 'new' to 'open' |
From @pmichaudOn Sun, May 25, 2008 at 12:18:28PM -0700, diakopter wrote:
The primary problem here is the same as the one given in RT#54802 -- Beyond that, at the moment Rakudo doesn't really understand Thanks, Pm |
The RT System itself - Status changed from 'new' to 'open' |
From @moritzTo the best of my knowledge this is solved in Rakudo 9d76f3, and we have |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#53814 (status was 'resolved')
Searchable as RT53814$
The text was updated successfully, but these errors were encountered: