records: Insert record type ABI checks in constructors.
authorLudovic Courtès <ludo@gnu.org>
Wed, 16 May 2018 08:05:24 +0000 (10:05 +0200)
committerLudovic Courtès <ludo@gnu.org>
Wed, 23 May 2018 08:21:02 +0000 (10:21 +0200)
commit7874bbbb9f09cc14ea3e179fd0fa10da5f90cfc7
tree858882215ed759814f841b714250434e975f604f
parent56f9d442e0b5624130042f69f33ea5bd7e970798
records: Insert record type ABI checks in constructors.

* guix/records.scm (print-record-abi-mismatch-error): New procedure.
<top level>: Add 'set-exception-printer!' call.
(current-abi-identifier, abi-check): New procedures.
(make-syntactic-constructor): Add #:abi-cookie parameter.  Insert calls
to 'abi-check'.
(define-record-type*)[compute-abi-cookie]: New procedure.
Use it and emit a definition of the 'current-abi-identifier' for TYPE.
* tests/records.scm ("ABI checks"): New test.
guix/records.scm
tests/records.scm