~ chicken-core (chicken-5) 7bd90e5d67101fdc96bddea077bc66b80fb744ee
commit 7bd90e5d67101fdc96bddea077bc66b80fb744ee Author: Evan Hanson <evhan@foldling.org> AuthorDate: Tue Jan 16 23:02:01 2018 +1300 Commit: Evan Hanson <evhan@foldling.org> CommitDate: Tue Jan 16 23:34:48 2018 +1300 Simplify `find-module/import-library' slightly We can use `or' to handle the situation where the module wasn't found, rather than `unless' and `set!'. diff --git a/modules.scm b/modules.scm index b02717cb..f726415c 100644 --- a/modules.scm +++ b/modules.scm @@ -581,11 +581,9 @@ (##sys#find-module mname 'import))))) (define (find-module/import-library lib loc) - (let* ((mname (##sys#resolve-module-name lib loc)) - (mod (##sys#find-module mname #f loc))) - (unless mod - (set! mod (##sys#import-library-hook mname))) - mod)) + (let ((mname (##sys#resolve-module-name lib loc))) + (or (##sys#find-module mname #f loc) + (##sys#import-library-hook mname)))) (define (##sys#decompose-import x r c loc) (let ((%only (r 'only))Trap