mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 22:59:16 +02:00
load shouldn't search for the file
This commit is contained in:
parent
f60b72dbc0
commit
27af40b2fa
1 changed files with 2 additions and 5 deletions
|
@ -956,15 +956,12 @@
|
||||||
(let ((thunk (compile x (if (pair? o) (car o) (interaction-environment)))))
|
(let ((thunk (compile x (if (pair? o) (car o) (interaction-environment)))))
|
||||||
(if (procedure? thunk) (thunk) (raise thunk))))
|
(if (procedure? thunk) (thunk) (raise thunk))))
|
||||||
|
|
||||||
(define (load base . o)
|
(define (load file . o)
|
||||||
(let* ((env (if (pair? o) (car o) (interaction-environment)))
|
(let* ((env (if (pair? o) (car o) (interaction-environment)))
|
||||||
(file (find-module-file base))
|
(len (string-length file))
|
||||||
(len (and file (string-length file)))
|
|
||||||
(ext *shared-object-extension*)
|
(ext *shared-object-extension*)
|
||||||
(ext-len (string-length ext)))
|
(ext-len (string-length ext)))
|
||||||
(cond
|
(cond
|
||||||
((not file)
|
|
||||||
(error "couldn't find file" base))
|
|
||||||
((and (> len ext-len 0) (equal? ext (substring file (- len ext-len))))
|
((and (> len ext-len 0) (equal? ext (substring file (- len ext-len))))
|
||||||
(%load file env))
|
(%load file env))
|
||||||
(else
|
(else
|
||||||
|
|
Loading…
Add table
Reference in a new issue