summaryrefslogtreecommitdiff
path: root/module/srfi/srfi-35.scm
AgeCommit message (Collapse)AuthorFilesLines
2019-11-04Rebase SRFI-35 on top of (ice-9 exceptions)Andy Wingo1-179/+69
* module/ice-9/exceptions.scm (exception-type?): New export. * module/srfi/srfi-35.scm: Rewrite in terms of (ice-9 exceptions).
2019-11-03Add `record-type-has-parent?'.Andy Wingo1-6/+2
* module/ice-9/boot-9.scm (record-type-has-parent?): New function. * module/srfi/srfi-35.scm (condition-type?): Use it.
2019-10-27Rename final? record type flag; add support for opaque?Andy Wingo1-2/+3
* module/ice-9/boot-9.scm (record-type-extensible?): Rename from record-type-final?, with the opposite sense. (record-type-opaque?): New accessor. (make-record-type): Change #:final? to #:extensible?, with the opposite meaning. Add #:opaque? arg. * test-suite/tests/records.test ("records"): Add opaque tests; update extensible tests. * doc/ref/api-data.texi (Records): Update. * module/srfi/srfi-35.scm (&condition, make-condition-type): Update for make-record-type API change.
2019-10-23Rebase srfi-35 conditions on top of make-record-typeAndy Wingo1-231/+135
* module/srfi/srfi-35.scm: Import (ice-9 match), and remove now-unused srfi-1 import. (print-condition): Print more like records, as appears to be the intention. (&condition): Define using make-record-type. Adapt all callers. Also, compound conditions are now a disjoint type, handled specially by condition-ref, condition?, and so on. * test-suite/tests/srfi-35.test (v3): Fix an error in which a subcondition was initialized without initializers for all of its fields.
2017-09-23Replace "pr" struct fields with "pw" fieldsAndy Wingo1-3/+3
* libguile/struct.h (SCM_VTABLE_BASE_LAYOUT): Layout is a "pr" field. * module/ice-9/boot-9.scm (record-type-vtable): Record vtable fields are writable. (<parameter>): "pw" fields. * module/oop/goops.scm (<class>, %compute-layout): <read-only> fields are "pw" underneath. * module/rnrs/records/procedural.scm (record-type-vtable) (record-constructor-vtable, make-record-type-descriptor): Use "pw" fields in vtables. * module/srfi/srfi-35.scm (%condition-type-vtable) (struct-layout-for-condition): "pw" fields in vtables. * test-suite/tests/goops.test: * test-suite/tests/structs.test: Use "pw" fields only. * benchmark-suite/benchmarks/structs.bm: Update for make-struct/no-tail, to use pw fields, and also to remove useless tests that the compiler would optimize away. * doc/ref/api-data.texi (Vtables): Add a note about the now-vestigial permissions character and update documentation. (Structure Basics, Meta-Vtables): Update examples. * libguile/hash.c (scm_i_struct_hash): Remove code that would handle opaque/self fields. * libguile/print.h (SCM_PRINT_STATE_LAYOUT): Use "pw" fields. * libguile/struct.c (scm_struct_init): Simplify check for hidden fields. * libguile/values.c (scm_init_values): Field is "pw".
2017-09-22Merge stable-2.2 into masterAndy Wingo1-11/+11
This commit resolves conflicts by removing the deprecated make-struct.
2017-09-20Use make-struct/no-tail instead of make-structAndy Wingo1-11/+11
* module/ice-9/boot-9.scm: * module/language/cps/effects-analysis.scm: * module/language/elisp/falias.scm: * module/language/tree-il.scm: * module/language/tree-il/primitives.scm: * module/rnrs/records/procedural.scm: * module/srfi/srfi-35.scm: * module/system/base/syntax.scm: Change uses of make-struct to make-struct/no-tail.
2017-09-14remove self field of vtablesAndy Wingo1-1/+0
* libguile/struct.h (SCM_VTABLE_BASE_LAYOUT, scm_vtable_index_self): Remove "self" field. Renumber the other fields. * module/oop/goops.scm (<self-slot>): Remove. (fold-class-slots): Adapt for "self" slot removal. Adapt all users. (class-redefinition): Now that there is no "self" slot to update, use %modify-instance instead of %modify-class. * libguile/goops.c (class_self): Remove. (scm_sys_modify_class): Remove. * libguile/goops.h (scm_sys_modify_class): Remove. * module/rnrs/records/procedural.scm: Import vtable-offset-user. Renumber rtd indexes using vtable-offset-user. * module/srfi/srfi-35.scm (%condition-type-vtable): Remove mention of vtable fields. * module/system/base/types.scm (address->inferior-struct): Adapt for different vtable field layout.
2011-11-24simplify %condition-type-vtableAndy Wingo1-8/+8
* module/srfi/srfi-35.scm (%condition-type-vtable): Use make-vtable instead of make-vtable-vtable.
2011-09-02more define-syntax-rule usageAndy Wingo1-18/+14
* module/ice-9/boot-9.scm: * module/ice-9/control.scm: * module/ice-9/futures.scm: * module/ice-9/optargs.scm: * module/ice-9/poll.scm: * module/ice-9/receive.scm: * module/ice-9/threads.scm: * module/ice-9/vlist.scm: * module/language/assembly/compile-bytecode.scm: * module/language/ecmascript/compile-tree-il.scm: * module/language/tree-il.scm: * module/oop/goops.scm: * module/oop/goops/simple.scm: * module/oop/goops/stklos.scm: * module/srfi/srfi-1.scm: * module/srfi/srfi-35.scm: * module/srfi/srfi-39.scm: * module/srfi/srfi-45.scm: * module/srfi/srfi-67/compare.scm: * module/sxml/match.scm: * module/system/repl/error-handling.scm: * module/system/repl/repl.scm: * module/system/vm/inspect.scm: * module/texinfo.scm: * module/web/server.scm: Use define-syntax-rule, where it makes sense.
2010-01-11Provide Guile-friendly `coding:' meta-data.Ludovic Courtès1-8/+3
* module/ice-9/i18n.scm, module/rnrs/bytevector.scm, module/rnrs/io/ports.scm, module/scripts/compile.scm, module/srfi/srfi-35.scm, module/srfi/srfi-88.scm: Write `coding:' comment at the top.
2009-11-15srfi-35 properly uses vtable-offset-userAndy Wingo1-3/+3
* module/srfi/srfi-35.scm (condition-type-id): (condition-type-parent, condition-type-all-fields): Don't ref fixed struct indices, use vtable-offset-user instead.
2009-11-10Improve the printer of SRFI-35 error conditions.Ludovic Courtès1-3/+16
* module/srfi/srfi-35.scm (print-condition): Print the name and value of each field.
2009-10-25SRFI-35: Provide nice vtable names, to make GOOPS happier.Ludovic Courtès1-11/+19
* module/srfi/srfi-35.scm (%make-condition-type): New procedure. (make-condition-type, make-compound-condition-type): Use it. * test-suite/tests/srfi-35.test ("condition types")["struct-vtable-name"]: New test.
2009-09-17Remove deprecation warnings from the buildNeil Jerram1-1/+0
* module/srfi/srfi-35.scm: Remove explicit use of (ice-9 syncase). * test-suite/tests/r5rs_pitfall.test: Same again. * test-suite/tests/syncase.test: Remove "(ice-9 syncase) loads" test; syncase is always loaded now.
2009-06-17Complete changing license to LGPLv3+Neil Jerram1-1/+1
(Still guile-readline to do, but that will all be GPLv3+.)
2009-05-22Rewrite SRFI-35 macros using `syntax-rules'.Ludovic Courtès1-32/+35
* module/srfi/srfi-35.scm: Use `(ice-9 syncase)'. (define-condition-type, condition): Rewritten using `syntax-rules'. (compound-condition, condition-instantiation): New helper internal macros. Thanks to Andy Wingo for his help!
2008-11-01move scm srfi files to module/srfi, and compile them.Andy Wingo1-0/+337
* .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.