Re: proposing a simpler mechanism
Per Bothner 13 Nov 2009 16:37 UTC
For completeness, I'd like to have:
(define (arg-count->bitmask min-count max-count) ...)
where min-count is the minimum number of arguments,
and max-count is the maximum number, or -1.
(A non-infinite maximum is useful for optional arguments.)
That is easy (just a couple of shifts and masks);
a little harder are the inverse functions:
(define (bitmask->min-count mask) ...)
(define (bitmask->max-count mask) ...)
I think these are expressible using bitwise-length and
bitwise-first-bit-set, but I haven't tried to work it out.
--
--Per Bothner
xxxxxx@bothner.com http://per.bothner.com/