Try:

new P0, 'std::array'  # PMC
new P1, 'Perl::PerlArray'    # PMC (or class)
new P2, 'Package::SomeClass'   # Class

At compile time the string can be converted to an integer enumerator.

-Melvin






Leopold Toetsch <[EMAIL PROTECTED]>
10/21/2003 10:24 AM
Please respond to lt

 
        To:     [EMAIL PROTECTED] (Dan Sugalski)
        cc:     [EMAIL PROTECTED]
        Subject:        Re: Object instantiation



Dan Sugalski <[EMAIL PROTECTED]> wrote:
> After thinking about this a bit, it became glaringly obvious that the
> right way to instantiate an object for class "Foo" is to do:

>   new P5, .Foo

> Or whatever the constant value assigned to the Foo class upon its 
creation
> is. When a class is created, it should be assigned a number, and for 
most
> things PMC-only classes or full-on HLL classes should behave 
identically.

Yep. The question does arise, if which range class enums are? Intermixed
with enum_class_<pmc> numbers?

And - what about:

  typeof S0, P0      <=> classname S0, P0

(IMHO the HLL compiler can't always know, which op to use)

And the classname of objects vs the classname of classes (the classname
PMC is in different array slots).

>  Dan

leo


Reply via email to