mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-03 19:26:34 +02:00
Added a few more functions
This commit is contained in:
parent
d405c749ca
commit
b9e0db08f2
1 changed files with 10 additions and 4 deletions
|
@ -7,6 +7,10 @@
|
|||
max
|
||||
min
|
||||
modulo
|
||||
floor-remainder
|
||||
even?
|
||||
; exact-integer?
|
||||
odd?
|
||||
call-with-current-continuation
|
||||
call/cc
|
||||
call-with-values
|
||||
|
@ -100,6 +104,7 @@
|
|||
round
|
||||
exact
|
||||
inexact
|
||||
|
||||
;;;;
|
||||
; Possibly missing functions:
|
||||
;
|
||||
|
@ -122,7 +127,6 @@
|
|||
; ;error-object?
|
||||
; ;file-error?
|
||||
; ;floor-quotient
|
||||
; ;floor-remainder
|
||||
; ;floor/
|
||||
; ;guard
|
||||
; ;import
|
||||
|
@ -172,9 +176,7 @@
|
|||
; eq?
|
||||
; equal?
|
||||
; eqv?
|
||||
; even?
|
||||
; exact-integer-sqrt
|
||||
; exact-integer?
|
||||
; exact?
|
||||
; expt
|
||||
; foldl
|
||||
|
@ -201,7 +203,6 @@
|
|||
; number->string
|
||||
; number?
|
||||
; numerator
|
||||
; odd?
|
||||
; open-input-bytevector
|
||||
; open-input-string
|
||||
; open-output-bytevector
|
||||
|
@ -863,6 +864,11 @@
|
|||
make_int(result, i % j);
|
||||
return_closcall1(data, k, &result);
|
||||
}")
|
||||
(define floor-remainder modulo)
|
||||
(define (odd? num) (= (modulo num 2) 1))
|
||||
(define (even? num) (= (modulo num 2) 0))
|
||||
; TODO: (define (exact-integer? num)
|
||||
; TODO: (and (exact? num) (integer? num)))
|
||||
(define (max first . rest) (foldl (lambda (old new) (if (> old new) old new)) first rest))
|
||||
(define (min first . rest) (foldl (lambda (old new) (if (< old new) old new)) first rest))
|
||||
))
|
||||
|
|
Loading…
Add table
Reference in a new issue