Nicholas Clark <[EMAIL PROTECTED]> wrote:
> On Wed, Nov 24, 2004 at 09:20:42AM +0100, Leopold Toetsch wrote:

>> 2) Opcode variants with mixed arguments
>>
>> Honestly
>>
>>    acos Nx, Iy
>>
>> and tons of other such opcodes are just overkill.

> Heck, why do we even have transcendental maths ops that take integer
> arguments or return integer results?

We have only the former. Returning integers would be still more silly.

> ... Can't we kill the lot?

Well, sure. But:

$ tail -1 ops/ops.num
get_repr_s_p    1532

We've additionally ~50 unblessed opcodes in experimental.ops. Now
tossing just the integer variants of these transcendentals reduces the
opcode count by 50.

> For everything that's intrinsically a function on real numbers, just take
> have N and P register variants.

Ehem, that increaes the opcode count. And how do you override an opcode?
What about:

  $P0 = new Complex
  $P0 = "1 + 2i"
  $P1 = sin $P0           # now what

I've shown a way to get rid of all these function-like opcodes.

  use overload 'sin' => \&my_sin;

becomes trivial then. 'sin' is a method call, always. And there is of
course Python:

  r = math.sin(s)

> Nicholas Clark

leo

Reply via email to