summaryrefslogtreecommitdiff
path: root/module/srfi/srfi-34.scm
AgeCommit message (Collapse)AuthorFilesLines
2020-01-10Re-implement `guard'Andy Wingo1-42/+6
* module/ice-9/exceptions.scm (guard): Add guard definition that re-propagates from original continuation, runs consequents in tail position in guard continuation, and doesn't rewind the stack. * module/srfi/srfi-34.scm: * module/rnrs/exceptions.scm (guard): Re-export from (ice-9 exceptions).
2019-11-29Associate #:replace info with modules, not variablesAndy Wingo1-1/+2
* doc/ref/api-modules.texi (Creating Guile Modules): Document #:re-export-and-replace. * module/ice-9/boot-9.scm (module-replacements): New module field. (make-module, make-autoload-interface): Initialize replacements to an empty hash table. (resolve-interface): Propagate replacement info when making custom interfaces. (define-module): Parse a #:re-export-and-replace keyword arg. (define-module*): Handle #:re-export-and-replace. (module-export!, module-re-export!): Add a keyword arg to indicate whether to replace or not. (module-replace!): Call module-export! with #:replace? #t. (duplicate-handlers): Update replace duplicate handler to look for replacement info on the interfaces. * module/srfi/srfi-18.scm (srfi): * module/srfi/srfi-34.scm (srfi): Update to #:re-export-and-replace raise-continuable as raise.
2019-11-13Rebase throw/catch on top of raise-exception/with-exception-handlerAndy Wingo1-32/+20
* libguile/exceptions.c: * libguile/exceptions.h: New files. * libguile.h: Add exceptions.h. * libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES): (DOT_X_FILES, DOT_DOC_FILES, modinclude_HEADERS): Add exceptions.c and exceptions.h. * libguile/init.c (scm_i_init_guile): Initialize exceptions. * libguile/threads.c (scm_spawn_thread): Use new names for scm_i_make_catch_handler and scm_c_make_thunk. * libguile/throw.c: Rewrite to be implemented in terms of with-exception-handler / raise-exception. * libguile/throw.h: Use data types from exceptions.h. Move scm_report_stack_overflow and scm_report_out_of_memory to exceptions.[ch]. * module/ice-9/boot-9.scm (&error, &programming-error) (&non-continuable, make-exception-from-throw, raise-exception) (with-exception-handler): New top-level definitions. (throw, catch, with-throw-handler): Rewrite in terms of with-exception-handler and raise-exception. : New top-level definitions. * module/ice-9/exceptions.scm: Adapt to re-export &error, &programming-error, &non-continuable, raise-exception, and with-exception-handler from boot-9. (make-quit-exception, guile-quit-exception-converter): New exception converters. (make-exception-from-throw): Override core binding. * test-suite/tests/eval.test ("inner trim with prompt tag"): Adapt to "with-exception-handler" being the procedure on the stack. ("outer trim with prompt tag"): Likewise. * test-suite/tests/exceptions.test (throw-test): Use pass-if-equal. * module/srfi/srfi-34.scm: Reimplement in terms of core exceptions, and make "guard" actually re-raise continuations with the original "raise" continuation.
2016-10-30Fix srfi-34 indentationAndy Wingo1-3/+3
* module/srfi/srfi-34.scm (with-exception-handler): Fix indentation.
2010-10-14re-implement srfi-34's guard with syntax-caseAndy Wingo1-12/+16
* module/srfi/srfi-34.scm (guard): Re-implement using syntax-case.
2010-06-06srfi-34 #:replace raise fixAndy Wingo1-3/+3
* module/srfi/srfi-34.scm: #:replace the binding for `raise'
2009-06-17Complete changing license to LGPLv3+Neil Jerram1-1/+1
(Still guile-readline to do, but that will all be GPLv3+.)
2009-01-12Merge commit 'origin/master' into vmAndy Wingo1-2/+2
Conflicts: .gitignore guile-tools.in srfi/srfi-19.scm
2008-11-01move scm srfi files to module/srfi, and compile them.Andy Wingo1-0/+80
* .gitignore: Add gdb-pre-inst-guile. * configure.in: Add module/srfi/Makefile. * module/Makefile.am: Add srfi/. * module/srfi/: SRFI scheme files moved here, and compiled. * srfi/Makefile.am: Remove the bits about the scheme files.