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

Re: Argument Patterns

Thread Previous | Thread Next
From:
Luke Palmer
Date:
March 9, 2005 02:15
Subject:
Re: Argument Patterns
Message ID:
20050309101707.GC2400@navi.cx
Thomas Sandlaß writes:
> Luke Palmer wrote:
> >But we always have enough knowledge to optimize the hell out of this,
> >and they're not not handwavy "we can probably" optimizations.  They're
> >real, and they're pretty darn easy.
> 
> I fully agree. But I like to add that a single 'where' on general
> types like Int, Str or even Any can seriously harm performance because
> than the dispatcher has to check it always and everywhere!  So the
> Perl 6 type system let's you have your rope and tie yourself.  Well,
> that is late binding :)

Only if you define an AUTOLOAD on your subtypes.  The way to think about
multimethod implementation problems is inside-out from how you think
about single dispatch.  The *method* is the one that knows everything,
not the object.  So definitions on subtypes of general types only check
for those subtypes when dispatching to the methods defined in them.

Luke

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