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

Re: Parameter and trait questions - just how 'only' _is_'read-only'?

Thread Previous | Thread Next
March 30, 2005 15:48
Re: Parameter and trait questions - just how 'only' _is_'read-only'?
Message ID:
On Wed, 2005-03-30 at 18:35 -0500, Aaron Sherman wrote:

> When the Perl 6 compiler sees:
>         my X $a;
>         $a.m(1);
> What should it do?
> Options:
>       * Accept the method call regardless of the definition of X
>       * Accept the method call if it matches the signature from X
>       * Accept the method call if {magic($*INTERP)}

That's a fair question, but I think you're leaving out several important
pieces of information:

	* Where does $a come from?  (As far as I see, it's just an
uninteresting undef here, but I don't know if that's the point of the
	* At what point in the program are you asking what the compiler sees?
	* Where's the definition of X in relation to this code?
	* What pragmas are in effect here?
	* What other code may have altered the type definition of X or undef?

I don't think anyone can answer your question well without assuming some
answers to my questions.

-- c

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