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

Integer PMCs

6 views
Skip to first unread message

Leopold Toetsch

unread,
Sep 3, 2004, 8:21:29 AM9/3/04
to perl6-i...@perl.org
[ resent ]

Date: Thu, 26 Aug 2004 09:17:52 +0200
Subject: Integer PMCs

Fog around integer PMC semantics is lifting, so we should start bringing
classes/*.pmc into shape.

Currently PerlInt is the most complete implementation of the proposed
semantics. Some vtable methods like C<subtract> still need work, though.

Anyway, I'd do:

1) cp perlint.pmc integer.pmc
2) pmclass PerlInt extends Integer {}
3) pmclass Py_int extends Integer {}

ad 1)

IIRC the class name of Parrot types should be mangled to "__Integer" or
some such. Last time I tested the PMC-compiler didn't really support to
define class names that differ from the filename.

ad 2) PerlInt is basically empty.

ad 3) almost empty except for invoke() as constructor. Class name could
be "Python_int" too, "Pythonint" doesn't really look good.

Maybe we postpone 2) and 3) until dynamic PMC creation stabilizes so
that we can move these classes over to dynclasses. Moving the Perl*
classes would also need a new commandline option --perl or -Mperlpmc or
some such or huge patches against t/pmc/*.t.

Comments welcome,
leo

Dan Sugalski

unread,
Sep 8, 2004, 9:25:07 AM9/8/04
to Leopold Toetsch, perl6-i...@perl.org
At 2:21 PM +0200 9/3/04, Leopold Toetsch wrote:
>[ resent ]
>
>Date: Thu, 26 Aug 2004 09:17:52 +0200
>Subject: Integer PMCs
>
>Fog around integer PMC semantics is lifting, so we should start bringing
>classes/*.pmc into shape.
>
>Currently PerlInt is the most complete implementation of the proposed
>semantics. Some vtable methods like C<subtract> still need work, though.
>
>Anyway, I'd do:
>
>1) cp perlint.pmc integer.pmc
>2) pmclass PerlInt extends Integer {}
>3) pmclass Py_int extends Integer {}
>
>ad 1)
>
>IIRC the class name of Parrot types should be mangled to "__Integer" or
>some such. Last time I tested the PMC-compiler didn't really support to
>define class names that differ from the filename.
>
>ad 2) PerlInt is basically empty.
>
>ad 3) almost empty except for invoke() as constructor. Class name could
>be "Python_int" too, "Pythonint" doesn't really look good.

I'd skip everything but #1 and fixing up integer.pmc to express the
semantics we've worked out. We can work on extending to the perl and
python integers after that.
--
Dan

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

0 new messages