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

Re: How are types related to classes and roles?

Thread Previous
Larry Wall
February 24, 2005 09:28
Re: How are types related to classes and roles?
Message ID:
On Thu, Feb 24, 2005 at 05:17:50PM +0000, Nicholas Clark wrote:
: On Fri, Feb 25, 2005 at 12:45:45AM +0800, Autrijus Tang wrote:
: > On Wed, Feb 23, 2005 at 12:17:19PM -0800, Larry Wall wrote:
: > > : And how does all this combine with the notion of context?
: > > 
: > > Lazily, for the most part.  In some cases we can determine context at
: > > compile time, but often not.  Certainly a subroutine cannot determine
: > > what context it was called in until it's actually called, unless we
: > > venture into return-value MMD, which has problems resolving against
: > > parameter MMD.
: > However, retval-based MMD is neccessary to ensure compile-time
: > dispatch, and plays really well with type inferencing in general.
: > So another solution is to mark ambiguate retval-based dispatches as
: > ill-typed, and let the programmer resolve it by explicit type
: > annotation.  But making it default is probably too much B&D.
: Not that the tail should wag the dog, but as I remember it, parrot can do
: return-value MMD "for free", because the continuation-passing style of
: function calling means that actually there's no difference between a
: function call and a function return. [It's all just one maze of non-local
: gotos :-)] So if I understand it correctly, there's no speed hit in doing
: return- value MMD. Just a sanity hit.

I belive that mechanism doesn't actually combine with parameter MMD
to pick the original routine to call based on context.  If I recall,
it only comes into play at the time you actually try to return.


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