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

"source"-vicinity

This page is part of the web mail archives of SRFI 59 from before July 7th, 2015. The new archives for SRFI 59 contain all messages, not just those from before July 7th, 2015.



Some Schemes support compile-time source inclusion.  Chez
Scheme has "include", which I've recently added to Kawa.
Often you want to include a file relative to the current
file, which suggests an include-relative syntax form.
To implement include-relative you'd need a "source-vicnity" concept.
This of course would have to be a macro, rather than a function.
But there is a complication: the source we want to be relative to
is not the implementation of include-relative, where the source-vicinity
form appears, but the source containing the include-relative form.

So this suggests a "source-vicinty" form that takes syntax form.
Chez Scheme and PLT (and probably others) have a way to extract
these using "source annotations"; Kawa also has a mechanism.

Unfortunately, many Scheme implementations may be unable to
extract the "source-vicinity" of a form, but a (source-relative PATH)
form may be possible to standardize.  At least it should be possible
to standardize include and include-relative - but probably in a
different SRFI.
--
	--Per Bothner
per@xxxxxxxxxxx   http://per.bothner.com/