This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
include vs include-relative
- From: Per Bothner <per at bothner dot com>
- To: kawa at sourceware dot org
- Date: Tue, 25 Nov 2014 23:48:20 -0800
- Subject: include vs include-relative
- Authentication-results: sourceware.org; auth=none
- References: <546F4449 dot 4050303 at hungry dot com> <546F85E7 dot 6020404 at bothner dot com> <546F8AD9 dot 6080404 at hungry dot com> <54726634 dot 9090105 at bothner dot com> <547437D7 dot 7060500 at bothner dot com> <54749C51 dot 9020301 at hungry dot com>
The question raised by Seth is: should the include form *by default* act
like include-relative by first searching relative to the current file?
This question only changs the default and it's a 1-line change, so it
easy to make. More detail:
Option 1: The default search order include, as currently checked in:
First current working directory (as returned by (current-path); then the
directory of the file containing the include form. Or expressed in the
syntax of the kawa.include.path property: ".:|"
Option 2: The other way round, i.e. "|".". The makes the default for include
the same as the default for include-relative.
Regardless: The would only change the default. Setting the kawa.include.path
property (or the Include.searchPath ThreadLocal) overrides the default path.
Also regardless: include-relative would search the directory of the file containing
the include form, and *then* whatever search path is specified for include (default
or non-default).
Advantage of Option 1: Better historical compatibility. Plus it's weird having
both include and include-relative if they do the same thing (at least by default).
Advantage of Option 2: 99% of the time you probably *do* want to first search
relative. Plus it is more compatible with spirit of the r7rs recommendation.
Anyone else have an opinion?
--
--Per Bothner
per@bothner.com http://per.bothner.com/