chibi-scheme/lib/chibi/iset/optimize.sld
Alex Shinn c52873e8b9 Prefer SRFI 33 over SRFI 60, preventing import cycles when a user has
a SRFI 60 installed which imports (scheme base).  This can still break
in theory if a user installs a third-party SRFI 33 in the search path
in front of the Chibi SRFI 33, but we can't always be safe against
such behavior.
Fixes issue #267.
2015-06-09 00:14:03 +09:00

19 lines
626 B
Scheme

(define-library (chibi iset optimize)
(cond-expand
(chibi (import (chibi) (srfi 9)))
(else (import (scheme base))))
(import (chibi iset base)
(chibi iset iterators)
(chibi iset constructors))
(cond-expand
((library (srfi 33)) (import (srfi 33)))
(else
(import (srfi 60))
(begin
(define (%mask size) (bitwise-not (arithmetic-shift -1 size)))
(define (extract-bit-field size position n)
(bitwise-and (%mask size) (arithmetic-shift n (- position)))))))
(include "optimize.scm")
(export
iset-balance iset-balance! iset-optimize iset-optimize! iset->code))