Debian Codegraph @

%3a143/helpers.sls

raw
1 ;; SRFI-143 r6rs helper implementation
2 ;;
3 ;; Implemnts the fxabs, fxremainder, and fxquotient procedures for the SRFI-143
4 ;; functions, using the provided r6rs generics or simple functions.
5 ;;
6 ;; Copyright (c) 2018 - 2020 Andrew W. Keep
7
8 (library (srfi :143 helpers)
9 (export fxabs fxremainder fxquotient)
10 (import (rnrs) (rnrs r5rs))
11
12 (define fxabs (lambda (i) (if (fx<? i 0) (fx- i) i)))
13
14 (define fxremainder (lambda (n d) (remainder n d)))
15
16 (define fxquotient (lambda (n d) (quotient n d))))