Nala Ginrut <nalagin...@gmail.com> writes: > I encountered a bug while trying include some file: > --------------------------cut------------------------ > scheme@(guile-user)> (include "aa.scm") > While compiling expression: > ERROR: In procedure string-length: Wrong type argument in position 1 > (expecting string): #f > --------------------------end------------------------
The problem is that when the filename passed to 'include' is a relative pathname, it interprets that pathname relative to the directory of the file containing the 'include' form. In this case, the 'include' form is not in a file at all, so that can't work. Obviously the error message should be improved, but the upshot is this: if you want to use 'include' from the REPL, or from some other port with no associated filename, then you must pass it an absolute pathname. In this case, I suppose the intuitive expectation is that the filename should be interpreted relative to the current working directory of the Guile process, but that is totally different than how 'include' is expected to work in the usual case. Personally, I think it would be a mistake to muddy the semantics of 'include' to support these two very different uses. When you're at the REPL, why not just use 'load' instead? Thoughts? Mark