lisp catch error

7 views
Skip to first unread message

Ralf Hemmecke

unread,
May 23, 2022, 5:46:51 PM5/23/22
to fricas-devel
For compiling hunchentoot into FRICASsys, of course, I must bring
configure.ac to tell me whether hunchentoot is available.

Unfortunately, I cannot simply say

echo "(require :asdf)(require :hunchentoot)" | sbcl

in order to figure out whether this works OK, since if it doesn't, then
I am stuck inside sbcl instead of just having a non-zero return value
from sbcl. Can someone help me with such a test.

Thank you
Ralf

Qian Yun

unread,
May 27, 2022, 9:08:14 AM5/27/22
to fricas...@googlegroups.com
Hi Ralf,

You can do it as follows:

echo "(handler-case (require :asdf) (require :hunchentoot) (error (c)
(sb-ext:exit :abort t)))" | sbcl

But as you can see, the use of "exit" makes it not portable.
To make it work for other lisps, try similar technique used in
"config.lisp".

- Qian
Reply all
Reply to author
Forward
0 new messages