~dieggsy/srfi-143

80ec3b1bff74320df436d18c7e14d3160c8da4ce — Cthulhu Ftaghn 4 years ago 98f7f27
removed unused rubber-chicken.scm
1 files changed, 0 insertions(+), 65 deletions(-)

D srfi-143/rubber-chicken.scm
D srfi-143/rubber-chicken.scm => srfi-143/rubber-chicken.scm +0 -65
@@ 1,65 0,0 @@
;;;; Portable (generic) versions of Chicken fixnum operations.

;;; All of these should be redefined on all systems that have actual
;;; fixnum support.  The names aren't necessarily the native Chicken
;;; names, but the names by which they are imported from the `chicken`
;;; module by srfi-143.scm, the Chicken module definition.

;;; Fixnum limits

;; 24 is the SRFI minimum width.  Here are some appropriate values for
;; other Schemes, 32-bit and 64-bit, that don't implement R6RS:
;; Gambit 30/61, Scheme48 30/61, Chibi 30/61, SCM 30/61,
;; STklos 30/61, Gauche 29/61, RScheme 29, MIT 26/56.

(define fx-width 24)
(define fx-greatest 8388607)
(define fx-least -8388608)

(define (fixnum? x)
  (and (exact-integer? x) (<= fx-least x fx-greatest)))

;;; Basic arithmetic

(define (fx+ i j) (+ i j))
(define (fx- i j) (- i j))
(define (fx* i j) (* i j))
(define (fxquotient i j) (quotient i j))
(define (fxremainder i j) (remainder i j))
(define (fxneg i) (- i))

;;; The following are defined as syntax, because they are never exported
;;; and are not recursive, so they will be automatically inlined.
;;; But if you have efficient procedural versions, by all means use them.

(define-syntax chicken:fxmax
  (syntax-rules ()
    ((chicken:fxmax i j) (if (> i j) i j))))

(define-syntax chicken:fxmin
  (syntax-rules ()
    ((chicken:fxmin i j) (if (< i j) i j))))

(define-syntax chicken:fx=
  (syntax-rules ()
    ((chicken:fx= i j) (= i j))))

(define-syntax chicken:fx<
  (syntax-rules ()
    ((chicken:fx< i j) (< i j))))

(define-syntax chicken:fx>
  (syntax-rules ()
    ((chicken:fx> i j) (> i j))))

(define-syntax chicken:fx<=
  (syntax-rules ()
    ((chicken:fx<= i j) (<= i j))))

(define-syntax chicken:fx>=
  (syntax-rules ()
    ((chicken:fx>= i j) (>= i j))))

(define (fxodd? i) (odd? i))

(define (fxeven? i) (even? i))