- fixed a minor import subversion bug.

- added 2-argument version of fllog.
This commit is contained in:
Abdulaziz Ghuloum 2008-08-04 16:44:24 -07:00
parent d778dcc2dd
commit 2b4e89bcf0
3 changed files with 20 additions and 9 deletions

View File

@ -338,10 +338,19 @@
(foreign-call "ikrt_fl_exp" x ($make-flonum)) (foreign-call "ikrt_fl_exp" x ($make-flonum))
(die 'flexp "not a flonum" x))) (die 'flexp "not a flonum" x)))
(define (fllog x) (define fllog
(if (flonum? x) (case-lambda
(foreign-call "ikrt_fl_log" x) [(x)
(die 'fllog "not a flonum" x))) (if (flonum? x)
(foreign-call "ikrt_fl_log" x)
(die 'fllog "not a flonum" x))]
[(x y)
(if (flonum? x)
(if (flonum? y)
(fl/ (foreign-call "ikrt_fl_log" x)
(foreign-call "ikrt_fl_log" y))
(die 'fllog "not a flonum" y))
(die 'fllog "not a flonum" x))]))
(define (flexpt x y) (define (flexpt x y)
(if (flonum? x) (if (flonum? x)

View File

@ -1 +1 @@
1569 1571

View File

@ -3262,10 +3262,11 @@
(else (cons (car ls) (remove-dups (cdr ls)))))) (else (cons (car ls) (remove-dups (cdr ls))))))
(define (parse-library-name spec) (define (parse-library-name spec)
(define (subversion? x) (define (subversion? x)
(and (integer? x) (exact? x) (>= x 0))) (let ([x (syntax->datum x)])
(and (integer? x) (exact? x) (>= x 0))))
(define (subversion-pred x*) (define (subversion-pred x*)
(syntax-match x* () (syntax-match x* ()
[n (subversion? (syntax->datum n)) [n (subversion? n)
(lambda (x) (= x (syntax->datum n)))] (lambda (x) (= x (syntax->datum n)))]
[(p? sub* ...) (eq? (syntax->datum p?) 'and) [(p? sub* ...) (eq? (syntax->datum p?) 'and)
(let ([p* (map subversion-pred sub*)]) (let ([p* (map subversion-pred sub*)])
@ -3280,9 +3281,10 @@
(lambda (x) (lambda (x)
(not (p x))))] (not (p x))))]
[(p? n) [(p? n)
(and (eq? (syntax->datum p?) '<=) (subversion? (syntax->datum n))) (and (eq? (syntax->datum p?) '<=) (subversion? n))
(lambda (x) (<= x (syntax->datum n)))] (lambda (x) (<= x (syntax->datum n)))]
[(p? n) (and (eq? (syntax->datum p?) '>=) (subversion? n)) [(p? n)
(and (eq? (syntax->datum p?) '>=) (subversion? n))
(lambda (x) (>= x (syntax->datum n)))] (lambda (x) (>= x (syntax->datum n)))]
[_ (syntax-violation 'import "invalid sub-version spec" spec x*)])) [_ (syntax-violation 'import "invalid sub-version spec" spec x*)]))
(define (version-pred x*) (define (version-pred x*)