Make define-cpointer-type declare its function with an inferred-name.

Closes PR 12296.
This commit is contained in:
Eric Dobson 2015-03-08 10:21:54 -07:00 committed by Matthew Flatt
parent 5895eabad1
commit acd1fe7f8d
2 changed files with 8 additions and 2 deletions

View File

@ -929,6 +929,10 @@
(require (only-in 'mod-cstruct-serialize))
;; ----------------------------------------
(define-cpointer-type _foo)
(test 'foo? object-name foo?)
;; ----------------------------------------

View File

@ -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)))))]))
;; ----------------------------------------------------------------------------