Hi Mark, On Fri 28 Jan 2011 01:47, Mark H Weaver <[email protected]> writes:
> I notice that numbers.c uses three different macros to define public > procedures: SCM_DEFINE, SCM_GPROC, and SCM_PRIMITIVE_GENERIC. I don't > see an obvious logic to the choices of which macro to use. For > example, `exact->inexact' uses SCM_GPROC whereas `inexact->exact' uses > SCM_DEFINE. Yeah, I have no idea why exact->inexact would be extensible and inexact->exact is not. (And perhaps we should deprecate those functions in favor of the R6RS spelling, `inexact' and `exact'. Another topic.) And I don't recall the practical difference between GPROC and PRIMITIVE_GENERIC. > What macro do you think I should use for the functions I'm writing? > Note that `div-and-mod' and `div0-and-mod0' will return two values. For now, SCM_DEFINE. We can change that later to PRIMITIVE_GENERIC if needed. > One more question: do you think I should give div/mod/div0/mod0 their > short R6RS names by default? Yes, I think. At least I remember coming to that conclusion at one point, before I had to move away from that work. We might want opcodes for some of these, also. Andy -- http://wingolog.org/
