This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: relative includes in r7rs library definitions



Here's a contrived example of the situation I'd like kawa to handle. The directory structure looks like this:

./test-kawa.scm
./foo.sld
./foo.scm
./blerg/foo.sld
./blerg/foo.scm

The two foo.scm files define functions of the same name but with different return values. The two foo.sld files wrap their respective foo.scm files into r7rs libraries. test-kawa.sld imports both and avoids a name conflict with (prefix ...).

Without -Dkawa.include.path='|:.' it prints:

this is the second one
this is the second one

(unless I cd to another directory before running the script... *then* I get the desired output. This helps illustrate why search paths should be relative to the including file, not the user's current directory)

with it, I get a crash.

./test-kawa.scm:12:32: unexpected exception while compiling: java.lang.IllegalArgumentException: Illegal character in path at index 37: ./scheme/base.sld-Dkawa.include.path=| java.lang.IllegalArgumentException: Illegal character in path at index 37: ./scheme/base.sld-Dkawa.include.path=|
    at java.net.URI.create(URI.java:859)

The output I'm hoping for is

this is the first one
this is the second one

Please see attached.

    -seth

On 11/25/2014 12:03 AM, Per Bothner wrote:


On 11/23/2014 02:56 PM, Per Bothner wrote:
I'm considering adding a "kawa.include.path" property (by analogy with
"kawa.import.path").  I need to decide on a syntax to mean "relative to
the importing file".  I'm considering using '|' - which is an illegal
character in Windows file names.  A path like "|/utils" would search
the utils subdirectory of the directory containing the current file.

Using this syntax, currently the search path for include-relative is "|:." while
the search path for plain include is ".:|", where "." is the value of
(current-path). The defaults would remain the same, but the "kawa.import.path"
property would override the default for include.  The search path for
include-relative would be "|" followed by the path for include.

I checked this in.

Attachment: kawa-relative-include-redux.tar.gz
Description: application/gzip


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]