Re: [CVS ci] pow, hash, instantiate

2004-12-07 Thread Sam Ruby
Leopold Toetsch wrote:
I've added a few ops and methods:
* pow MMD function and opcodes
* hash vtable and opcode
Both aren't yet implemented in classes/*
The new_extended opcode and vtable got renamed to the more appropriate 
instantiate. classes/complex.pmc has an implementation of this method, 
the default is a fallback to pmc_new().
Excellent!
Question: what is the difference (conceptually) between new and 
instantiate?  If they are different, these differences should be 
highlighted.  If not, the opcode should be named the same in both cases.

Also, I would prefer not to have to deal with implicit registers. 
new_p_p would be the method signature I would prefer.  The name of the 
vtable entry could remain instantiate.

- Sam Ruby


Re: [CVS ci] pow, hash, instantiate

2004-12-07 Thread Leopold Toetsch
Sam Ruby [EMAIL PROTECTED] wrote:

 Excellent!

Welcome.

 Question: what is the difference (conceptually) between new and
 instantiate?  If they are different, these differences should be
 highlighted.  If not, the opcode should be named the same in both cases.

$ perldoc -F ops/pmc.ops

   instantiate(out PMC)
   Create a new PMC of the type of class REG_PMC(2). This
   is a classmethod.  Arguments are passed according to
   the calling conventions in
   docs/pdds/pdd03_calling_conventions.pod. See also the
   getclass opcode to get a class PMC.


 Also, I would prefer not to have to deal with implicit registers.

How do you pass a variable amount of initializers then?

E.g.

  .local pmc cl, o
  cl = getclass Complex
  o = cl.instantiate(2, 3)
  o = cl.instantiate(2 + 3i)

 - Sam Ruby

leo