I have a reasonably complex .csirc in which I (use) several eggs. Whenever I copy my .csirc onto a new machine I always have to spend a few minutes commenting large swaths of it out because I haven't yet chicken-installed all of the requisite eggs. It's annoying enough that I tried to let the code sort it out for me. However, my naive attempt crashes and burns because I can't get Chicken to avoid expanding the (import ...) form.
What I'm trying to do amounts to this:
(handle-exceptions exn
(print "chicken-doc hasn't been installed!")
(require chicken-doc)
(import chicken-doc))
But the import happens in such a way that I cannot avoid it even in
the face of the (require ...) form failing.
% csi -:a5
Error: (import) during expansion of (import ...) - cannot import from undefined
module: chicken-doc
Call history:
<syntax> (##sys#call-with-values (##core#lambda () (require
chicken-doc) (import chicken-doc)) (##core#lambda......
<syntax> (##core#lambda () (require chicken-doc) (import
chicken-doc))
<syntax> (##core#begin (require chicken-doc) (import
chicken-doc))
<syntax> (require chicken-doc)
<syntax> (import chicken-doc) <--
I suppose this is because (require ...) happens at runtime and
whatever (import ...) does happens when the syntax is expanded.
Is there a clean way to achieve the effect of reporting a missing egg
with an error message (and leaving my interpreter otherwise usable)?
--
Erik Falor
Registered Linux User #445632 http://linuxcounter.net
pgpfmdou96FUz.pgp
Description: PGP signature
_______________________________________________ Chicken-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-users
