develooper Front page | perl.perl6.internals | Postings from September 2001

Re: PDD 6: Parrot Assembly Language

Thread Previous | Thread Next
From:
Dan Sugalski
Date:
September 10, 2001 18:00
Subject:
Re: PDD 6: Parrot Assembly Language
Message ID:
5.1.0.14.2.20010910205905.0266fdf8@pop.sidhe.org
At 09:05 PM 9/10/2001 -0400, Ken Fox wrote:
>Dan Sugalski wrote:
> > At 05:41 PM 9/10/2001 -0400, Ken Fox wrote:
> > > You're expecting the current lexical scope to be carried implicitly
> > > via the PC?
> >
> > No, it'll be in the interpreter struct.
>
>But how does the interpreter know where a lexical scope begins
>and ends in the bytecode? For example, a "jump FOO" might change
>scopes. How is the scope discovered?

   jump FOO

doesn't change scope.

   newscope scope_template_in_fixup_section

does. And

   exitscope

leaves one. :)

> > >This only lets us use multi-methods where arg0 is an object. Is
> > >this sufficient for implementing Perl 6?
> >
> > Ummm... how on earth do you plan on calling a method of something that's
> > not an object? Methods sorta require them... :)
>
>sub add(int x, int y) : multi { ... }
>sub add(int x, num y) : multi { ... }
>sub add(num x, num y) : multi { ... }
>
>That makes sense to me. My syntax is probably wrong, but the intention
>is clear. I'd be surprised if Damian doesn't want this.

Ah, multimethod subroutines. Those are a different beast entirely. For 
those the destination sub code is responsible for dispatch, that way you 
only pay the penalty to decode the arg types for those subs that actually 
do multimethodish things.

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk


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