Hi!
Andreas Rottmann <[email protected]> writes:
> +SCM_DEFINE (scm_fixnum_p, "fixnum?", 1, 0, 0,
> + (SCM x),
> + "Return @code{#t} if @var{x} is a fixnum, @code{#f} otherwise.")
> +#define FUNC_NAME s_scm_fixnum_p
> +{
> + return scm_from_bool (SCM_I_INUMP (x));
> +}
> +#undef FUNC_NAME
For 2.0 I think you could go with this wonderful hack:
(define (fixnum? x)
(not (= 0 (logand 2 (object-address x)))))
(An inlinable variant thereof, as done in srfi-9.scm.)
For ‘master’ your patch looks good to me modulo a few details. Why did
you need to renumber VM opcodes? Also, I’d prefer not to have ‘fixnum?’
in the default name space because:
1. In Guile parlance, it’d rather be ‘immediate-number?’ (info
"(guile) Immediate objects").
2. I think this fixnum thing is a breach in the numerical tower.
Thanks,
Ludo’.