Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Objects, finally (try 1)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dan Sugalski  
View profile  
 More options Jan 11 2003, 5:48 pm
Newsgroups: perl.perl6.internals
From: d...@sidhe.org (Dan Sugalski)
Date: Sat, 11 Jan 2003 13:25:37 -0500
Local: Sat, Jan 11 2003 1:25 pm
Subject: Re: Objects, finally (try 1)
At 4:08 PM +0000 1/11/03, Nicholas Clark wrote:

>On Thu, Jan 09, 2003 at 04:40:20PM -0500, Dan Sugalski wrote:
>>  The find_method vtable entry should die, and be replaced with a plain
>>  method entry. This should return either the address of the start of
>>  the method's bytecode, or NULL. The NULL return is for those cases
>>  where the method actually executed via native code, and thus doesn't
>>  have to go anywhere. If an address is returned it's expected that the
>>  engine will immediately dispatch to that spot, obeying parrot's
>>  calling conventions.

>What about the case where the object doesn't have the method you're asking
>for? You seem to be using NULL to mean something other than "not found",
>so does that mean not found is an exception?

Sorry. The assumption is one of three things happen:

1) A value is returned, which is the address of the parrot code to dispatch to
2) A NULL is returned, which indicates the method call has been made
and the interpreter can proceed to the next instruction in the stream
3) An exception is thrown, indicating that the method couldn't be called.

>And if NULL is returned it is expected that the method has already been
>called? If so, there doesn't seem to be any way to find out if a PMC
>possesses (modulo AUTOLOAD) a method, without the danger of it being called.

If we don't have a can in the vtable, then we need to fix that. :)

>Will there be anything built in at parrot level like Perl's AUTOLOAD system?
>Or will that have to be done explicitly by the perl6 code generator wrapping
>methods in a routine that catches the "not found" exception, and attempts to
>use AUTOLOAD? [and whatever multimatch despatch system perl6 will be using to
>find the "best" method]

Parrot will have an AUTOLOAD-style fallback mechanism available to
it. I'll add that to the design todo list for the edited version of
objects.
--
                                         Dan

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.