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
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to