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

MMD and redefinition

June 3, 2005 15:49
MMD and redefinition
Message ID:
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?


 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About