This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: 'require' crashes inside functions
- To: Jocelyn Paine <popx at pop3 dot ifs dot org dot uk>
- Subject: Re: 'require' crashes inside functions
- From: Per Bothner <per at bothner dot com>
- Date: 23 Aug 2001 17:39:31 -0700
- Cc: kawa at sourceware dot cygnus dot com
- References: <Pine.LNX.4.10.10108240039010.17687-100000@pop3.ifs.org.uk>
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/