[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Universal Catch

    From: kessler%utah-orion@utah-cs.arpa (Robert Kessler)
    Message-Id: <8511200136.AA07391@utah-orion.ARPA>
    To: RWK@scrc-yukon.arpa
    Subject: Re:  Universal Catch
    Cc: common-lisp@su-ai.arpa

    Yes, a catch barrier is what I am thinking about.  My top loop analogy
    was just that, you want to be able to keep any errors or extraneous throws
    from leaving your top loop.  One does need to be able to get the value
    of the tag though.  I suppose that one could use a really disgusting
    hack with unwind-protect where instead of exiting in the cleanup forms,
    the code could recursively call the top loop.  Geez that would be a real
    hack ;-)


You don't need a recursive call. Below will keep doing <stuff> forever.

  (loop (block toplevel
          (unwind-protect <stuff>
                          (return-from toplevel nil))))

Of course it doesn't give you access to the tag that was thrown to.