mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 22:10:21 +02:00
Hack around a defect in `define-wrapped-pointer-type'.
* module/system/foreign.scm (define-wrapped-pointer-type): Choose TYPE-NAME deterministically.
This commit is contained in:
parent
6debc49e2c
commit
8a302b9f78
1 changed files with 13 additions and 2 deletions
|
@ -179,8 +179,19 @@ pointer object and returns an object that satisfies PRED, and UNWRAP
|
|||
which does the reverse. PRINT must name a user-defined object printer."
|
||||
(syntax-case stx ()
|
||||
((_ pred wrap unwrap print)
|
||||
(with-syntax ((type-name (datum->syntax #'pred (gensym)))
|
||||
(%wrap (datum->syntax #'wrap (gensym))))
|
||||
(and (symbol? (syntax->datum #'pred))
|
||||
(symbol? (syntax->datum #'wrap))
|
||||
(symbol? (syntax->datum #'unwrap)))
|
||||
|
||||
;; Choose TYPE-NAME deterministically to help separate
|
||||
;; compilation. It could be an arg of the macro, but that would
|
||||
;; expose an implementation detail.
|
||||
(with-syntax ((type-name (datum->syntax
|
||||
#'pred
|
||||
(symbol-append '%%
|
||||
(syntax->datum #'pred)
|
||||
'-type-name)))
|
||||
(%wrap (datum->syntax #'wrap (gensym "wrap"))))
|
||||
#'(begin
|
||||
(define-record-type type-name
|
||||
(%wrap pointer)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue