develooper Front page | perl.perl6.language | Postings from May 2005

foo(1: 2: 3: 4:) ?

Thread Next
Autrijus Tang
May 20, 2005 00:24
foo(1: 2: 3: 4:) ?
Message ID:
So I'm finally starting to implement multi-level invocants in MMDs.
I'd like to sanity check some cases first, though.

Are these two assumed to be identical?

    multi sub foo ($x, $y)
    multi sub foo ($x, $y : )

But these two are _not_ identical?

    multi sub foo ($x : $y : $z)
    multi sub foo ($x : $y : $z : )

Is multiple colons usable in invocation?  If yes, is these two
assumed to be identical?

    $$b : $c);
    foo($a : $b : $c);

S12 says all the following cases "come out to the same thing":

    $handle.close	# 1
    close($handle)	# 2
    close $handle:	# 3
    close $handle	# 4

Does it mean that during invocation, when there is no colons and
no dots, an implicit colon is added at the end, making all arguments
same-level invocants and subject to MMD?  That is, these are identical:

    foo($a, $b)
    foo($a, $b : )

But these two are _not_:

    foo($a : $b : $c)
    foo($a : $b : $c : )


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About