[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-janitors] Re: #268: Chicken 4.5.0 has a strange issue with out-
From: |
Chicken Trac |
Subject: |
[Chicken-janitors] Re: #268: Chicken 4.5.0 has a strange issue with out-of-module imports |
Date: |
Tue, 08 Jun 2010 09:40:37 -0000 |
#268: Chicken 4.5.0 has a strange issue with out-of-module imports
------------------------------------------+---------------------------------
Reporter: sjamaan | Owner: sjamaan
Type: defect | Status: assigned
Priority: critical | Milestone:
Component: extensions | Version: 4.5.x
Keywords: macros, s48-modules, modules |
------------------------------------------+---------------------------------
Changes (by felix):
* owner: felix => sjamaan
* status: accepted => assigned
Comment:
Below is a patch for s48-modules that seems to help. That extension
definitely was incorrect for not importing `include-relative`, since it is
used for the `files` clause. Why it seems to work with modules removed I
can't say right now. Since modules are syntax-stripped anyway, all the
renaming doesn't make much of a difference.
I also fixed a problem for using `include-relative` outside of a loaded
file.
Please try the patch and tag a new version, if it works for you.
{{{
Index: s48-modules.scm
===================================================================
--- s48-modules.scm (revision 18383)
+++ s48-modules.scm (working copy)
@@ -26,7 +26,11 @@
(define-syntax include-relative
(lambda (x r c)
(let* ((old-file (s48-modules:get-current-file))
- (file (make-pathname (pathname-directory old-file) (cadr
x))))
+ (file (make-pathname
+ (if old-file
+ (pathname-directory old-file)
+ ".")
+ (cadr x))))
`(,(r 'begin)
(,(r 's48-modules:set-current-file!) ,file)
(,(r 'include) ,file)
@@ -176,7 +180,7 @@
"invalid structure clause"
clause))))))
(let ((names (map (lambda (n) (##sys#strip-syntax (car n))) (cadr
x))))
- (when (and (memq #:compiling ##sys#features)
+ (when (and (feature? #:compiling)
(any (lambda (n) (assq n ##compiler#import-
libraries))
names))
(set! ##compiler#import-libraries
@@ -185,7 +189,9 @@
(string-append (symbol->string iname1) ".import.scm")
##compiler#import-libraries) ) ) )
`(,%begin
- (,%module ,iname1 * ,@(process-body (cddr x) #f))
+ (,%module ,iname1 *
+ (import (only s48-modules include-relative))
+ ,@(process-body (cddr x) #f))
,@(map process1 (cadr x))))))
)
}}}
--
Ticket URL: <http://www.irp.oist.jp/trac/chicken/ticket/268#comment:3>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.