This is the mail archive of the kawa@sources.redhat.com 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]

Re: 'require' crashes inside functions


Jocelyn Paine <popx@pop3.ifs.org.uk> writes:

> I've just experimented and discovered that I can't use a variable argument
> to require, e.g.
>   (set! x <myclass>)
>   (require x)
> 
> I get told
>  <msg_stdin> 4.2: invalid specifier for 'require'

That is inherent in require, which imports and makes visible the
definitions at *compile* time.  You wouldn't be able to meaningfully
do require except at top-level otherwise (though as you saw that's
not implemented), or import macros.

> I suppose I could write all the specifiers to a scratch file and then
> load that, but is there a better way?

I guess you could write a macro that calls eval.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


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