Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8708081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:02:07+00:00 2026-06-13T04:02:07+00:00

I am using sbcl 1.0.57.0 and want to start a program via –eval which

  • 0

I am using sbcl 1.0.57.0 and want to start a program via --eval which should generate some output, but in case that there is an uncaught error it shall exit.

I figured the easiest way to accomplish that would be by using unwind-protect:

(unwind-protect (error 'simple-error) 
  (progn (FORMAT t "IAMREACHED~%") (sb-ext:exit)))

As (sb-ext:exit) should be executet incase there is an uncaught error.

But it doesn’t!

* (unwind-protect (error 'simple-error) 

       (progn (FORMAT t "IAMREACHED~%") (sb-ext:exit)))

    debugger invoked on a SIMPLE-ERROR in thread
    #<THREAD "main thread" RUNNING {1002979193}>:
    (A SIMPLE-ERROR was caught when trying to print *DEBUG-CONDITION* when entering
    the debugger. Printing was aborted and the SIMPLE-ERROR was stored in
    SB-DEBUG::*NESTED-DEBUG-CONDITION*.)

    Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

    restarts (invokable by number or by possibly-abbreviated name):
      0: [ABORT] Exit debugger, returning to top level.

    (#:EVAL-THUNK)
    0] 0
    IAMREACHED

What is my misconception about the workings of unwind-protect?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:02:09+00:00Added an answer on June 13, 2026 at 4:02 am

    UNWIND-PROTECT is an analogue of finally clause in Java or Python, so it’s not a catch-all clause, that will intercept any unhandled condition. For that you need a HANDLER-CASE with a handler clause for type CONDITION.

    UNWIND-PROTECT actually works in your case. The only “unexpected” behaviour is that the debugger is invoked before the body of UNWIND-PROTECT is executed. The reason for this is not to lose the current context and be able to restart execution. It is (probably) achieved via HANDLER-BIND. You can learn more about that in PCL chapter “Conditions and Restarts”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to connect to MySQL from SBCL using CLSQL. I loaded CLSQL using
I am currently have a small program in Common Lisp, which I want to
I want to pass sbcl a string as a single argument using a bashcript
Using C#, I want to show the image in the Access column but failed
Using a populated Table Type as the source for a TSQL-Merge. I want to
While writing a simple game using SBCL, CL-OPENGL, and Lispbuilder-SDL, I can across a
I'm trying to learn common lisp currently and I've been using sbcl (I hope
In the past, i use the following script to start SBCL: breakchars=(){}[],^%$#@\\;:''|\\ cd /media/E/work
Using MVC2 I have an AJAX form which is posting to a bound model.
I have been looking for some good statistics package for Common Lisp, that should

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.