guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: include can't work


From: Mark H Weaver
Subject: Re: include can't work
Date: Sat, 16 Nov 2013 22:19:01 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Nala Ginrut <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]