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
From:
chromatic
Date:
March 30, 2005 12:49
Subject:
Re: Parameter and trait questions - just how 'only' _is_'read-only'?
Message ID:
1112215749.28733.27.camel@localhost
On Wed, 2005-03-30 at 15:27 -0500, Aaron Sherman wrote:

> Like I said, if you allow run-time munging of the type interfaces, then
> you can't tell if this is valid or invalid:
> 
> 	my X $a;
> 	$a.m(1);
> 
> you have to allow it always, regardless of the definition of X. In fact,
> you can NEVER reject ANY method or function invocation based on
> signature, since it might change at run-time.
> 
> Is that really what you want?

I want the possibility to correct bad decisions of interfaces and
signatures whenever possible in the most minimally intrusive way
possible.  I don't want to work around a module or class or function or
method where someone tried to be helpful by saying "Oh, this will
absolutely never change, ever" and the compiler helpfully froze that
decision forever.  Sometimes that means changing it outside the
incorrect code.

I don't trust any compiler to make every decision correctly, and in
cases of ambiguity I believe that I can give it better hints than it can
reason for itself if I need the extra speed or safely.

A compiler that assumes incorrectly and disallows programmers to do
useful things because its holds those assumptions as precious is wrong
-- especially in cases where even the programmer can't tell if code is
valid or invalid until the program actually runs.

-- c


Thread Previous | Thread Next


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