* added an auxilary procedure library-exists? for the library
manager.
This commit is contained in:
parent
22b191334f
commit
97cd3dc461
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -45,6 +45,11 @@
|
||||||
(find-library-by
|
(find-library-by
|
||||||
(lambda (x) (equal? (library-name x) name))))
|
(lambda (x) (equal? (library-name x) name))))
|
||||||
|
|
||||||
|
(define (library-exists? name)
|
||||||
|
(and (find-library-by
|
||||||
|
(lambda (x) (equal? (library-name x) name)))
|
||||||
|
#t))
|
||||||
|
|
||||||
(define (find-library-by-spec/die spec)
|
(define (find-library-by-spec/die spec)
|
||||||
(let ([id (car spec)])
|
(let ([id (car spec)])
|
||||||
(or (find-library-by
|
(or (find-library-by
|
||||||
|
@ -60,7 +65,7 @@
|
||||||
[inv-lib* (map find-library-by-spec/die inv*)])
|
[inv-lib* (map find-library-by-spec/die inv*)])
|
||||||
(unless (and (symbol? id) (list? name) (list? ver))
|
(unless (and (symbol? id) (list? name) (list? ver))
|
||||||
(error 'install-library "invalid spec ~s ~s ~s" id name ver))
|
(error 'install-library "invalid spec ~s ~s ~s" id name ver))
|
||||||
(when (find-library-by-name name)
|
(when (library-exists? name)
|
||||||
(error 'install-library "~s is already installed" name))
|
(error 'install-library "~s is already installed" name))
|
||||||
(let ([lib (make-library id name ver imp-lib* vis-lib* inv-lib*
|
(let ([lib (make-library id name ver imp-lib* vis-lib* inv-lib*
|
||||||
exp-subst exp-env visit-code invoke-code)])
|
exp-subst exp-env visit-code invoke-code)])
|
||||||
|
|
Loading…
Reference in New Issue