This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Implementing load-path for Kawa


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]