chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] [PATCH][5] Include files relative to the current s


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH][5] Include files relative to the current source file
Date: Sat, 16 Jul 2016 20:11:01 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Sat, May 28, 2016 at 11:01:56PM +1200, Evan Hanson wrote:
> Hi folks,
> 
> Here's another patch for chicken-5. It makes "(include ...)" search for
> files relative to the including file. Relative includes are given the
> lowest search priority, i.e. they are only used when the included file
> isn't found in the CWD or any of the directories specified with the
> "-include-path" option.

I've looked at this patch just now, but I'm unsure what the use of it is.
It would only make things more confusing.  Having a clear rule that
"include" will always search the current dir or the dirs in the include
path make more sense, to me at least.  This would also means "include"
behaves differently from "load" and "load-relative".

IMHO, include should do one or the other: relatively to file or the
current dir, but not both.

> I considered two alternative approaches when implementing this feature.
> One was to leave the current behaviour of `include` alone and instead
> add a new `include-relative` form (similarly to how we have both `load`
> and `load-relative`), and the other was to make the relative inclusion
> behaviour toggleable with a parameter. Both seemed like unnecessary
> knobs to me.

An include-relative is defined by the s48-modules egg.  I think it makes
more sense to have that, especially considering we also have load-relative.

I'm not sure whether it would make more sense to have include-relative
also honor the include path or not.

Cheers,
Peter

Attachment: signature.asc
Description: Digital signature


reply via email to

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