At 03:51 PM 9/8/2001 -0700, Matthew Cline wrote:
>On Saturday 08 September 2001 09:00 am, Dan Sugalski wrote:
>
> > Okay, I'm whipping together the "fancy math" section of the interpreter
> > assembly language. I've got:
> >
> > sin, cos, tan         : Plain ones
> > asin, acos, atan      : arc-whatevers
> > shinh, cosh, tanh     : Hyperbolic whatevers
> > log2, log10, log      : Base 2, base 10, and explicit base logarithms
> > pow                   : Raise x to the y power
> >
> > Can anyone think of things I've forgotten? It's been a while since I've
> > done numeric work.
>
>
>Sorry for being clueless, but why are "fancy math" operators being included
>in the opcodes, rather than being callable functions?

* Some folks will use them, which is good. (Some will use them a lot)
* Being an opcode makes things like this easier:

    @foo = tan @bar; # Take the tan of each element of bar and store in foo

* Parrot's getting its first source release on monday, and I expect a 
goodly number of folks would like to try their hand at writing opcode 
functions, and these are straightforward.

>Does each builtin
>function have an opcode?

Most of them will, yep. (I can't say all just because we're not done with 
the list yet)

Many perl subs will also end up as opcode functions. Generally if we have a 
fixed list of inputs and outputs, there's no reason not to use an opcode 
instead of an actual perl sub.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to