[plt-scheme] include and sub-directories

From: Carl Eastlund (carl.eastlund at gmail.com)
Date: Thu Nov 19 18:42:35 EST 2009

Good catch.


The docs for include (linked immediately above) refer to module paths
as interpreted by require.


The docs for require (linked immediately above) define a module path
using the following prose:

"A path relative to the containing source (as determined by
current-load-relative-directory or current-directory). Regardless of
the current platform, rel-string is always parsed as a Unix-format
relative path: / is the path delimiter (multiple adjacent /s are
treated as a single delimiter), .. accesses the parent directory, and
. accesses the current directory. The path cannot be empty or contain
a leading or trailing slash, path elements before than the last one
cannot include a file suffix (i.e., a . in an element other than . or
..), and the only allowed characters are ASCII letters, ASCII digits,
-, +, _, ., /, and %. Furthermore, a % is allowed only when followed
by two lowercase hexadecimal digits, and the digits must form a number
that is not the ASCII value of a letter, digit, -, +, or _."

For better or for worse, it states that "path elements before than the
last one cannot include a file suffix (i.e., a . in an element other
than . or ..)".

So what you have run into is an annoying and obscure feature, but a
documented and apparently intentional one.

Carl Eastlund

On Thu, Nov 19, 2009 at 6:34 PM, Dave Herman <dherman at ccs.neu.edu> wrote:
> A-ha. My example wasn't quite sufficient to demonstrate the bug. It's when
> the directory has dots in the name:
>    #lang scheme/base
>    (require scheme/include)
>    (include "foo-0.2.1/bar.scm")
> Error: include: bad relative pathname string in "foo-0.2.1/bar.scm"
> Dave

Posted on the users mailing list.