[honu] add format and a facility to convert floats to integers

This commit is contained in:
Jon Rafkind 2011-11-14 16:49:47 -07:00
parent 9d393f991f
commit 9ec39fd590
2 changed files with 7 additions and 0 deletions

View File

@ -24,6 +24,8 @@
length length
substring substring
void void
format
integer
(rename-out [honu-cond cond] (rename-out [honu-cond cond]
[null empty] [null empty]
[current-inexact-milliseconds currentMilliseconds] [current-inexact-milliseconds currentMilliseconds]

View File

@ -10,6 +10,11 @@
(provide sqr) (provide sqr)
(define (sqr x) (* x x)) (define (sqr x) (* x x))
;; convert a float to an integer
(provide integer)
(define (integer x)
(inexact->exact (round x)))
(provide honu-cond) (provide honu-cond)
(define-honu-syntax honu-cond (define-honu-syntax honu-cond
(lambda (code context) (lambda (code context)