Re: Trig functions for vtables

2003-09-23 Thread Dave Whipp
"Brent Dax" <[EMAIL PROTECTED]> wrote: > # > The result would mean that something like: > # > pmc->vtable->add > # > # > Might become: > # > pmc->vtable->math->add > # > # Seems too expensive to me for the normal math stuff. > > Perhaps, although one dereference doesn't seem to painful to me. Is t

RE: Trig functions for vtables

2003-09-23 Thread Dan Sugalski
On Tue, 23 Sep 2003, Brent Dax wrote: > Leopold Toetsch: > # That's what happening anyway. All unimplemented stuff has a default > hook > # throwing an exception. > > The indirection would allow for a default set. It's the difference > between eight default pointers per vtable (to default sectio

RE: Trig functions for vtables

2003-09-23 Thread Brent Dax
Leopold Toetsch: # Dan was talking about one vtable slot, holding another vtable for trig # and log functions. The newly added vtable->data seems to be that. This # trig_log (or data) pointer is shared by all scalar classes. So that # takes one additional pointer per vtable and one additional trig_

Re: Trig functions for vtables

2003-09-23 Thread Dan Sugalski
On Mon, 22 Sep 2003, Gregor N. Purdy wrote: > On a related note, I wonder how all this fits in with > methods and multimethods? One-arg vtable methods don't have to do multimethod stuff, since you're calling the vtable method on the argument, so it can do the right thing without checking. Two

Re: Trig functions for vtables

2003-09-23 Thread Nicholas Clark
On Mon, Sep 22, 2003 at 04:08:24PM -0600, Luke Palmer wrote: > And let's not forget our handy trig identities. We definitely don't > need all those vtable. Technically, all we need are sine and arccosine. I believe that atan2() is more useful than arccosine, as it returns information about whic

Re: Trig functions for vtables

2003-09-23 Thread Leopold Toetsch
Brent Dax <[EMAIL PROTECTED]> wrote: > Okay, reality check. How often are we going to use acosh? Is it really > worth the space in the vtable for that few calls? And why can't we just > use find_method? Dan was talking about one vtable slot, holding another vtable for trig and log functions. T

Re: Trig functions for vtables

2003-09-22 Thread Gregor N. Purdy
On a related note, I wonder how all this fits in with methods and multimethods? If we consider the current trig.ops as being equivalent to, e.g. (expressed with approximate Perl 6 isms): multi sub sin(Num $arg) : returns Num; multi sub cos(Num $arg) : returns Num; And, at some level I do

Re: Trig functions for vtables

2003-09-22 Thread Luke Palmer
Brent Dax writes: > Dan Sugalski: > # Okay, since it seems reasonable to hang the trig functions off of > PMCs, > # we'd best get a list of the functions we want. I can think of: > # > # pow > # logarithm > # square root (yes, I know, it's for speed) > # > # Normal and hyperbolic versions o

RE: Trig functions for vtables

2003-09-22 Thread Brent Dax
(Forgot to send this to the list. Again. *sighs*) Dan Sugalski: # Okay, since it seems reasonable to hang the trig functions off of PMCs, # we'd best get a list of the functions we want. I can think of: # # pow # logarithm # square root (yes, I know, it's for speed) # # Normal and hyperb