Closes PR 12006
This commit is contained in:
Matthew Flatt 2011-08-02 17:15:23 -06:00
parent 3ffa731f80
commit 9a14b47ccc

View File

@ -7,12 +7,12 @@ The unsafe @racket[cpointer-has-tag?] and @racket[cpointer-push-tag!]
operations manage tags to distinguish pointer types. operations manage tags to distinguish pointer types.
@defproc*[([(_cpointer [tag any/c] @defproc*[([(_cpointer [tag any/c]
[ptr-type ctype? _xpointer] [ptr-type ctype? _pointer]
[scheme-to-c (any/c . -> . any/c) values] [scheme-to-c (any/c . -> . any/c) values]
[c-to-scheme (any/c . -> . any/c) values]) [c-to-scheme (any/c . -> . any/c) values])
ctype] ctype]
[(_cpointer/null [tag any/c] [(_cpointer/null [tag any/c]
[ptr-type ctype? _xpointer] [ptr-type ctype? _pointer]
[scheme-to-c (any/c . -> . any/c) values] [scheme-to-c (any/c . -> . any/c) values]
[c-to-scheme (any/c . -> . any/c) values]) [c-to-scheme (any/c . -> . any/c) values])
ctype])]{ ctype])]{
@ -42,14 +42,15 @@ are not tagged.}
@defform*[[(define-cpointer-type _id) @defform*[[(define-cpointer-type _id)
(define-cpointer-type _id scheme-to-c-expr) (define-cpointer-type _id ptr-type-expr)
(define-cpointer-type _id scheme-to-c-expr c-to-scheme-expr)]]{ (define-cpointer-type _id ptr-type-expr
scheme-to-c-expr c-to-scheme-expr)]]{
A macro version of @racket[_cpointer] and @racket[_cpointer/null], A macro version of @racket[_cpointer] and @racket[_cpointer/null],
using the defined name for a tag string, and defining a predicate using the defined name for a tag string, and defining a predicate
too. The @racket[_id] must start with @litchar{_}. too. The @racket[_id] must start with @litchar{_}.
The optional expression produces optional arguments to @racket[_cpointer]. The optional expressions produce optional arguments to @racket[_cpointer].
In addition to defining @racket[_id] to a type generated by In addition to defining @racket[_id] to a type generated by
@racket[_cpointer], @racket[_id]@racketidfont{/null} is bound to a @racket[_cpointer], @racket[_id]@racketidfont{/null} is bound to a