Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Implementing ISA

5 views
Skip to first unread message

Leopold Toetsch

unread,
Aug 25, 2003, 2:40:44 PM8/25/03
to P6I
When looking at vtables (and *.ops) I'm missing C<isa>.

isa(out INT, in PMC, im STR) # set $1 to 1 if class $2 isa $3.
isa(out PMC, in PMC)
# set $1 to a const array containing $2's classes (parent first)
new P0, .PerlArray
isa P1, P0 # ("PerlArray", "Array", "array")

The last entry ("array") is generated by the system out of some flags.
This is the general type of the PMC (e.g. array, hash, sub, scalar,
struct), so that code like this works:

new P5, .PerlArray
invoke
...
isa I0, P5, "array"
if I0, yep_has_array_interface

Comments welcome
leo

Chromatic

unread,
Aug 25, 2003, 4:08:31 PM8/25/03
to Leopold Toetsch, P6I
On Monday, August 25, 2003, at 11:40 AM, Leopold Toetsch wrote:

> new P5, .PerlArray
> invoke
> ...
> isa I0, P5, "array"
> if I0, yep_has_array_interface

I would expect 'does' instead of 'isa'. Perhaps I missed Dan's
explanation of the difference between 'can', 'isa', and 'does'. Maybe
I'm thinking of 'has', though.

-- c

Chris Dutton

unread,
Aug 25, 2003, 5:38:43 PM8/25/03
to P6I
----- Original Message -----
From: "chromatic" <chro...@wgz.org>> I would expect 'does' instead of
'isa'. Perhaps I missed Dan's
> explanation of the difference between 'can', 'isa', and 'does'. Maybe
> I'm thinking of 'has', though.

Though I'm not familiar with the answer that's "official" for Parrot, but
perhaps "does" should be an alias for "has" as it applies to methods.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.509 / Virus Database: 306 - Release Date: 8/12/2003

0 new messages