This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Implementing load-path for Kawa
- From: Per Bothner <per at bothner dot com>
- To: Gerald Boersma <gerald at bright1 dot com>
- Cc: kawa at sourceware dot org
- Date: Fri, 27 May 2011 23:48:18 -0700
- Subject: Re: Implementing load-path for Kawa
- References: <88DB3D9B-A10A-404D-9B88-48035D7DCF27@bright1.com>
On 05/27/2011 11:12 PM, Gerald Boersma wrote:
Hi:
I am trying to implement load-path support in Kawa. I am a newbie to Scheme and Kawa. I have run into something that I do not understand, perhaps with Scheme macros or perhaps with a Kawa variation.
...
However, (eval include (null-environment)) returns #<procedure include>, and (eval require (null-environment)) returns #<procedure require>. So it looks like it is getting a procedure.
Not for me (using the current Subversion version, but I don't think this
has changed
in a while):
#|kawa:1|# (eval include (null-environment))
#<macro include>
#|kawa:2|# (eval require (null-environment))
#<syntax require>
These should probably be syntax errors instead.
I suspect that there is some nuance to Scheme macros that I am not understanding. From looking at the Kawa source code, include is defined as a schema 'define-syntax' macro and require is a Java class that subclasses Syntax. However, I am not sure how that pertains to the errors that I am seeing.
They are both syntax, which is "evaluated" (or "expanded") at
compile-time, so a run-time
load-path would have no effect
I rather discourage using load and eval. People reach for them too easily,
and they're usually the wrong thing to use, because the don't integrate well
with Scheme's lexical scoping or Kawa's compilation focus. So I'm reluctant
to add load-path support without a strong justification.
--
--Per Bothner
per@bothner.com http://per.bothner.com/