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 how do I instantiate? -- was: Objects!
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
 
Michal Wallace  
View profile  
 More options Jan 7 2004, 7:49 pm
Newsgroups: perl.perl6.internals
From: mic...@sabren.com (Michal Wallace)
Date: Wed, 7 Jan 2004 19:07:48 -0500 (EST)
Local: Wed, Jan 7 2004 7:07 pm
Subject: how do I instantiate? -- was: Objects!

On Tue, 2 Dec 2003, Dan Sugalski wrote:
> *) Creating new objects involves calling the ->init vtable entry *on
> the class*. Because of this each class gets a custom vtable where the
> init method has been swapped out for one (from objects.c) that
> creates a new object instead.

Well, cool! How do I this from parrot?

I've been trying things along the lines of:

.sub _main
   .local object Cat
   .local object felix
   newclass Cat, "Cat"
   P2 = Cat
   S0 = "init"
   callmeth
   felix = P0
   #...
   end
.end

... But haven't figured out the magic formula yet
That code above gives:

   Method 'init' not found
           in file '(unknown file)' near line -1

(If anyone can post a working example of the code
above I'd really appreciate it!)

Sincerely,

Michal J Wallace
Sabren Enterprises, Inc.
-------------------------------------
contact: mic...@sabren.com
hosting: http://www.cornerhost.com/
my site: http://www.withoutane.com/
--------------------------------------


 
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.