HP3000-L Archives

March 1998, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Michael D. Hensley" <[log in to unmask]>
Reply To:
Date:
Mon, 2 Mar 1998 10:28:30 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (46 lines)
I'm *WAY* behind in email, but someone asked about the TRY-RECOVER macros
Eugene Volokh included in his "How Programming Languages Differ" paper (it's
more of a book).

By the way, you can read this paper at
http://www.adager.com/TechnicalPapers.html

Just for fun: A free copy of the FREEWARE tape for the first person to email
me the name of the the paper I wrote, quite a while ago, which is there
somewhere.

---cut here---
/* ---------------------------------------------------------------- */
/* Contents: try/escape/recover defines                             */
/* Author  : Tim Chase / Eugene Volokh                              */
/* Comments: Error-handling mechanism                               */
/*           (must #include <jmpbuf.h>)                             */
/* Usage   :                                                        */
/*           try                                                    */
/*              statement;                                          */
/*           recover                                                */
/*              statement;                                          */
/*                                                                  */
/*           escape(escapecode);                                    */
/* ---------------------------------------------------------------- */


/* - global declarations ------------------------------------------ */

int escapecode;
int jump_stack_ptr = -1;
jmp_buf jump_stack[1000];   /* the stack used to do nesting */

#define try if (setjmp(jump_stack[++jump_stack_ptr])==0) {
#define recover jump_stack_ptr--; } else
#define escape(parm) \
        { \
        escapecode = parm; \
        longjmp(jump_stack[jump_stack_ptr--], 1); \
        }

---
Michael D. Hensley       | mailto:[log in to unmask]
Allegro Consultants Inc. |
408/252-2330             | Visit scenic http://www.allegro.com

ATOM RSS1 RSS2