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

MMD and redefinition

From:
dakkar
Date:
June 3, 2005 15:49
Subject:
MMD and redefinition
Message ID:
42A09A88.4010201@thenautilus.net
In Perl5, if I do:

 sub foo {return 1}
 sub foo {return 2}
 print foo();

I get a redefinition error, and a '2' on STDOUT. Can I assume this will
be the same in Perl6? i.e. can I write a test for pugs to check this?

Moreover:

 sub foo(Num $a) {return 1}
 sub foo(Str $a) {return 2}
 print foo(1),foo('a');

should have the same effect? Printing 2 twice? I don't expect MMD on
non-multi subs.

--
	Dakkar - <Mobilis in mobile>
	GPG public key fingerprint = A071 E618 DD2C 5901 9574
	                             6FE2 40EA 9883 7519 3F88
	                    key id = 0x75193F88



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About