Leo~

On Mon, 28 Mar 2005 12:22:29 +0200, Leopold Toetsch <[EMAIL PROTECTED]> wrote:
> Leopold Toetsch <[EMAIL PROTECTED]> wrote:
> 
> > 5) infix method signature change:
> 
> >    METHOD PMC* add( [INTERP, SELF,] PMC* rhs, PMC ´*dest) {
> >      if (!dest)
> >         dest = pmc_new(INTERP, SELF->vtable->base_type);
> >      ...
> >      return dest;
> >    }
> 
> > If the destination PMC is passed in, it's used else a new PMC of an
> > appropriate type is created.
> 
> The same scheme should of course be introduced with all the unary prefix
> and postfix operators:
> 
>   METHOD PMC* absolute( [INTERP, SELF,] PMC ´*dest) {
>     if (PMC_IS_NULL(dest))
>        dest = pmc_new(INTERP, SELF->vtable->base_type);
>     VTABLE_set_integer_native(INTERP, dest, abs(PMC_int_val(SELF)));
>     return dest;
>   }
> 
> and
> 
>   op abs(out PMC, in PMC)
>   op n_abs(out PMC, in PMC)

Why bother with the IS_NULL check if we have the "n_" variant already?
 Why not have one option unconditionally use the destination pmc and
the other unconditionally create a new destination pmc?

Matt
-- 
"Computer Science is merely the post-Turing Decline of Formal Systems Theory."
-???

Reply via email to