On Tue, 2 Mar 2004, Jens Rieks wrote:

> from pdd 15:
> :  instantiate Px, Py, Sz (Unimplemented)
> :      Instantiate a brand new class, based on the metadata
> :      in Py, named Sz.
> I think I have missread this last time. What it is op supposed to do?
>
> How can I create an object of class the "Block"?

    newclass P1, "Block"    # Creates a "Block" class
    find_type I0, "Block"   # Gets Parrot's internal index no. for the
                            # "Block" class
    new P2, I0              # Creates an object in that class

  This really needs to be spelled out better in the PDD -- it is mentioned
  in an example, but I don't think it's covered in the discussion of
  object-related opcodes.

  NB. The code above just creates the object -- you still need to init.
  the data by hand.

  Simon


Reply via email to