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]

require in eval produces IllegalArgumentException


I've got a library which loads files containing Scheme expressions and
calls eval on them to construct objects (I'm using lists as my data
structure and the reader as my file parser).

This used to work, at least as late as r7521 (my program still works
on a different machine with that version), so something broke after
that.

Now, I get errors which look like:

java.lang.IllegalArgumentException: Illegal character in path at index 0: <eval>
	at java.net.URI.create(URI.java:859)
	at java.net.URI.resolve(URI.java:1043)
	at gnu.kawa.io.FilePath.resolve(FilePath.java:270)
	at gnu.kawa.io.Path.resolve(Path.java:277)
	at gnu.kawa.io.Path.getAbsolute(Path.java:389)
	at kawa.standard.ImportFromLibrary.handleImport(ImportFromLibrary.java:257)
	at kawa.standard.require.scanForDefinitions(require.java:177)
	at kawa.lang.Syntax.scanForm(Syntax.java:57)
	at kawa.lang.Translator.scanForm(Translator.java:1502)
	at kawa.lang.Translator.scanBody(Translator.java:1560)
	at kawa.standard.begin.scanForm(begin.java:23)
	at kawa.lang.Translator.scanForm(Translator.java:1502)
	at kawa.lang.Translator.scanBody(Translator.java:1560)
	at kawa.lang.Eval.evalBody(Eval.java:85)
	at kawa.lang.Eval.evalForm$X(Eval.java:26)
	at kawa.lib.scheme.eval.eval$X(eval.scm:10)
	at kawa.lib.scheme.eval.eval$X(eval.scm)
	[...]

This is very similar to the error produced by invoking Kawa with:

	$ kawa -e "(eval '(require <abc>))"

java.lang.IllegalArgumentException: Illegal character in path at index 0: <string>
	at java.net.URI.create(URI.java:859)
	at java.net.URI.resolve(URI.java:1043)
	at gnu.kawa.io.FilePath.resolve(FilePath.java:270)
	at gnu.kawa.io.Path.resolve(Path.java:277)
	at gnu.kawa.io.Path.getAbsolute(Path.java:389)
	at kawa.standard.ImportFromLibrary.handleImport(ImportFromLibrary.java:257)
	at kawa.standard.require.scanForDefinitions(require.java:177)
	at kawa.lang.Syntax.scanForm(Syntax.java:57)
	at kawa.lang.Translator.scanForm(Translator.java:1502)
	at kawa.lang.Translator.scanBody(Translator.java:1560)
	at kawa.lang.Eval.evalBody(Eval.java:85)
	at kawa.lang.Eval.evalForm$X(Eval.java:26)
	at kawa.lib.scheme.eval.eval$X(eval.scm:10)
	at kawa.lib.scheme.eval.eval$X(eval.scm)
	at atInteractiveLevel$1.run(<string>:1)
	[...]


except that in the latter case the illegal path is "<string>" rather
than "<eval>".


I've simplified it down to the attached three files (one represents
the library, one represents the file to load, and the third is
the application).  Stick the three in the current directory and try

	$ kawa app.scm

java.lang.IllegalArgumentException: Illegal character in path at index 0: <eval>
	at java.net.URI.create(URI.java:859)
	at java.net.URI.resolve(URI.java:1043)
	[...]


I'm guessing this is related to the problem/resolution here:

https://sourceware.org/ml/kawa/2014-q2/msg00070.html


--
Jamison Hope
The PTR Group
www.theptrgroup.com


Attachment: app.scm
Description: Binary data

Attachment: load.scm
Description: Binary data

Attachment: Thing1.txt
Description: Text document


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