From: Taylor R Campbell Date: Mon, 13 Sep 2010 15:28:31 +0000 (+0000) Subject: New macro BEGIN0. X-Git-Tag: 20101212-Gtk~57 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=b8a0d136a9a9f97deab9a5d0e8ec199d1351515e;p=mit-scheme.git New macro BEGIN0. (BEGIN0 ...) evaluates , executes ..., and then returns the value of . (Cf. Common Lisp's PROG1.) --- 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)