Make define-cpointer-type declare its function with an inferred-name.
Closes PR 12296.
This commit is contained in:
parent
5895eabad1
commit
acd1fe7f8d
|
@ -929,6 +929,10 @@
|
|||
|
||||
(require (only-in 'mod-cstruct-serialize))
|
||||
|
||||
;; ----------------------------------------
|
||||
|
||||
(define-cpointer-type _foo)
|
||||
(test 'foo? object-name foo?)
|
||||
|
||||
;; ----------------------------------------
|
||||
|
||||
|
|
|
@ -1294,10 +1294,12 @@
|
|||
[_TYPE/null (id "_" name "/null")])
|
||||
#'(define-values (_TYPE _TYPE/null TYPE? TYPE-tag)
|
||||
(let ([TYPE-tag 'TYPE])
|
||||
;; Make the predicate function have the right inferred name
|
||||
(define (TYPE? x)
|
||||
(and (cpointer? x) (cpointer-has-tag? x TYPE-tag)))
|
||||
(values (_cpointer TYPE-tag ptr-type scheme->c c->scheme)
|
||||
(_cpointer/null TYPE-tag ptr-type scheme->c c->scheme)
|
||||
(lambda (x)
|
||||
(and (cpointer? x) (cpointer-has-tag? x TYPE-tag)))
|
||||
TYPE?
|
||||
TYPE-tag)))))]))
|
||||
|
||||
;; ----------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue
Block a user