From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bengt Richter Newsgroups: gmane.lisp.guile.bugs Subject: bug#49452: Confusing behavior with (include) used in file in GUILE_LOAD_PATH Date: Wed, 7 Jul 2021 23:22:56 +0200 Message-ID: <20210707212256.GA2266@LionPure> References: <7b37a89f-39a6-1433-daf4-469a40656a6b@gatech.edu> Reply-To: Bengt Richter Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2666"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 49452@debbugs.gnu.org To: Vijay Marupudi Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Wed Jul 07 23:24:07 2021 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1F1b-0000Zv-KO for guile-bugs@m.gmane-mx.org; Wed, 07 Jul 2021 23:24:07 +0200 Original-Received: from localhost ([::1]:51762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1F1a-0003FO-Jc for guile-bugs@m.gmane-mx.org; Wed, 07 Jul 2021 17:24:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1F1W-0003FF-Fe for bug-guile@gnu.org; Wed, 07 Jul 2021 17:24:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42109) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1F1W-0005Mc-8i for bug-guile@gnu.org; Wed, 07 Jul 2021 17:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m1F1V-00054x-SQ for bug-guile@gnu.org; Wed, 07 Jul 2021 17:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bengt Richter Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 07 Jul 2021 21:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49452 X-GNU-PR-Package: guile Original-Received: via spool by 49452-submit@debbugs.gnu.org id=B49452.162569299019458 (code B ref 49452); Wed, 07 Jul 2021 21:24:01 +0000 Original-Received: (at 49452) by debbugs.gnu.org; 7 Jul 2021 21:23:10 +0000 Original-Received: from localhost ([127.0.0.1]:53655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1F0g-00053m-7T for submit@debbugs.gnu.org; Wed, 07 Jul 2021 17:23:10 -0400 Original-Received: from imta-37.everyone.net ([216.200.145.37]:34448 helo=imta-38.everyone.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1F0e-00053c-6h for 49452@debbugs.gnu.org; Wed, 07 Jul 2021 17:23:08 -0400 Original-Received: from pps.filterd (omta004.sj2.proofpoint.com [127.0.0.1]) by imta-38.everyone.net (8.16.0.43/8.16.0.43) with SMTP id 167LCvdP018169; Wed, 7 Jul 2021 14:23:06 -0700 X-Eon-Originating-Account: kilUXqgwSWrDyOFqjsLrM4qo6m9x7L5CD1v4nQ4A43Q X-Eon-Dm: m0117124.ppops.net Original-Received: by m0117124.mta.everyone.net (EON-AUTHRELAY2 - 5a81c3da) id m0117124.60d3a86c.109299; Wed, 7 Jul 2021 14:23:05 -0700 X-Eon-Sig: AQMHrIJg5hs5u/wpFAIAAAAC,b1045872096b0e15bcd02fbb216a4d25 X-Eip: lnIrDHTGfYt7EAV3yLEQRv6wc7vJl0_O7VpWxc2wTNE Content-Disposition: inline In-Reply-To: <7b37a89f-39a6-1433-daf4-469a40656a6b@gatech.edu> X-Proofpoint-GUID: 9YbP1ch8zRgePsE4yFfU7KOkVoBsslIo X-Proofpoint-ORIG-GUID: 9YbP1ch8zRgePsE4yFfU7KOkVoBsslIo X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-07_09:2021-07-06, 2021-07-07 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 clxscore=1034 priorityscore=1501 bulkscore=0 suspectscore=0 phishscore=0 mlxscore=0 malwarescore=0 impostorscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107070122 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:10140 Archived-At: Hi Vijay, On +2021-07-06 19:31:38 -0500, Vijay Marupudi wrote: > Hello all, > > It is unclear to me what the intended behavior for (include > "filename.scm") is, so I'm sending an email about this potential bug. > > The Local Inclusion docs > > seem to state that relative paths are found relative to the file that > included them. > > > If file-name is a relative path, it is searched for relative to the > > path that contains the file that the include form appears in. > > So if I have a file "/libraries/libname/main.scm" than has (include > "./helpers.scm"), then the file "/libraries/libname/helpers.scm" > *should* (I think) be imported. > A little nit, but (include "filename.scm") is not identical to (include "./filename.scm") so might it be worth trying (include "helpers.scm") in your code? And/or should the docs explain that both ways of writing a relative file name in this context are or are not acceptable? Might some macro dislike leading dots? Long shot ;-) > But this does not seem to work if "/libraries" is in the GUILE_LOAD_PATH > and my current working directory is somewhere else, say "/home/user" and > I'm running "/home/user/program.scm" that imports the (libname main) > library from "/libraries". Then Guile seems to try to include the > "libname/helpers.scm" file from the current directory, which does not > exist. > > Conversations with leoprikler in IRC have revealed to me that > call-with-include-port is the function responsible for this behavior > . > `syntax-source` returns a file path relative to the load path, and > include tries to use that path to open a file relative to the current > working directory. > > In Guile's bug guidelines > , > to me this fits > > * Whenever documentation and actual behavior differ, you have certainly > found a bug, either in the documentation or in the program. > > and potentially > > * When some part of the documentation is not clear and does not make > sense to you even after re-reading the section, it is a bug. > > I believe this is a bug, but I may be wrong, so emailing to clarify. > Thank you! > > Vijay Marupudi > PhD Student in Human Centered-Computing > Georgia Institute of Technology > > > > -- Regards, Bengt Richter