public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: "Sudarshan S Chawathe" <chaw@eip10.org>
To: kawa <kawa@sourceware.org>
Subject: Effect of include-library-declarations on "current root" for import
Date: Wed, 01 Mar 2017 21:52:00 -0000	[thread overview]
Message-ID: <1897.1488405149@vereq.eip10.org> (raw)

This question is about "current root" as used in the "searching for
source files" section of the manual (within "importing from a library").

The main question is: Is the "current root" for library imports spliced
in using include-library-declarations (potentially) different from the
"current root" of the file containing the include-library-declarations?

My understanding of the description in the manual, and the recent thread
on this mailing list ("import path vs CLASSPATH") is that when a library
definition in a file alpha.sld uses

  (include-library-declarations "../foo/bar/common.scm")

to splice in some forms, the current root for any imports in common.scm
is the same as the current root for alpha.sld, regardless of the
location of common.scm.

However, that does not appear to be true, based on the small example
included below.  (If I move common.scm to the "ab" directory and change
"../common.scm" to "common.scm" then there are no errors.)

I am not sure if this is intended/desirable behavior.

Regards,

-chaw


Example...

$ cat test-ab.scm
(import (scheme base)
        (scheme write)
        (alpha))
(write "test-ab")
(write alpha)
(newline)

$ cat alpha.sld
(define-library (alpha)
  (export alpha)
  (import (scheme base)
          (scheme write))
  (include-library-declarations "../common.scm")
  (begin
    (write "alpha, bravo: ")
    (write bravo)
    (newline)
    (define alpha bravo)))

$ cat ../common.scm
(import (bravo))

$ cat bravo.sld
(define-library (bravo)
  (export bravo)
  (import (scheme base)
          (scheme write))
  (begin
    (write "bravo")
    (newline)
    (define bravo 6)))

$ kawa -Dkawa.import.path="./*.sld" test-ab.scm
/home/chaw/res/scheme/kawa/misc/ab/../common.scm:1:9: unknown library (bravo)
/home/chaw/res/scheme/kawa/misc/ab/alpha.sld:8:12: warning - no declaration seen for bravo
/home/chaw/res/scheme/kawa/misc/ab/alpha.sld:10:19: warning - no declaration seen for bravo

$ kawa --version
Kawa 2.3.1 (git describe: kawa-2.3-4-gcb36c64-dirty)
Copyright (C) 2017 Per Bothner

$ uname -a
Linux vereq.eip10.org 3.16.0-4-686-pae #1 SMP Debian 3.16.39-1+deb8u1 (2017-02-22) i686 GNU/Linux
$ 

             reply	other threads:[~2017-03-01 21:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01 21:52 Sudarshan S Chawathe [this message]
2017-03-01 22:47 ` Per Bothner
2017-03-01 23:05   ` Sudarshan S Chawathe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1897.1488405149@vereq.eip10.org \
    --to=chaw@eip10.org \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).