From b8a0d136a9a9f97deab9a5d0e8ec199d1351515e Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Mon, 13 Sep 2010 15:28:31 +0000 Subject: [PATCH] New macro BEGIN0. (BEGIN0 ...) evaluates , executes ..., and then returns the value of . (Cf. Common Lisp's PROG1.) --- src/microcode/uxsig.c | 2 +- src/runtime/mit-macros.scm | 9 ++++++++- src/runtime/runtime.pkg | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/microcode/uxsig.c b/src/microcode/uxsig.c index f91c16ee9..eb011b627 100644 --- a/src/microcode/uxsig.c +++ b/src/microcode/uxsig.c @@ -549,9 +549,9 @@ DEFUN_STD_HANDLER (sighnd_terminate, static DEFUN_STD_HANDLER (sighnd_fpe, { + FPE_RESET_TRAPS (); if (executing_scheme_primitive_p ()) error_floating_point_exception (); - FPE_RESET_TRAPS (); trap_handler ("floating-point exception", signo, info, scp); }) #endif diff --git a/src/runtime/mit-macros.scm b/src/runtime/mit-macros.scm index e142fb39f..98deb9031 100644 --- a/src/runtime/mit-macros.scm +++ b/src/runtime/mit-macros.scm @@ -564,4 +564,11 @@ USA. `(,keyword:unspecific)) (define (unassigned-expression) - `(,keyword:unassigned)) \ No newline at end of file + `(,keyword:unassigned)) + +(define-syntax :begin0 + (syntax-rules () + ((BEGIN0 form0 form1+ ...) + (LET ((RESULT form0)) + form1+ ... + RESULT)))) \ No newline at end of file diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 47fa4d19b..390d57e7b 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -4599,6 +4599,7 @@ USA. (access :access) (and :and) (and-let* :and-let*) + (begin0 :begin0) (case :case) (cond :cond) (cond-expand :cond-expand) -- 2.25.1