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 10:51
Re: Parameter and trait questions - just how 'only' _is_ 'read-only'?
Message ID:
Larry Wall wrote:
> I think it's perfectly fine for the compiler to make use of whatever
> information it has.  The trick is to never make any unwarranted
> assumptions, such as "Nobody will ever add another class with an 'm'
> method."

Er, isn't that not just the wrong way around? The point is to do the
bookkeeping that an object is needed that does .meth() and that it
is stored in $a, and to complain when that is not the case when it
should be. The earlier the better.

I don't understand why writing 'my X $a' needs at least a declaration
of X, but then '$a.meth()' does not consider '.meth' as a bare method
that needs a declaration in X? Polymorphism is about requiring that
objects do compare and then sort a bunch of them using that particular
role---not more not less. Or think of US Postal just transporting letters
irrespective of them containing Anthrax or not, as long as they bear the
right stamps!
TSa (Thomas SandlaƟ)

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