From 2a222a8f1528e71042ae704d1f3ea8fd72661c60 Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Tue, 7 Jun 2016 15:19:59 -0400 Subject: [PATCH] Add examples for _? C type --- pkgs/racket-doc/scribblings/foreign/types.scrbl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pkgs/racket-doc/scribblings/foreign/types.scrbl b/pkgs/racket-doc/scribblings/foreign/types.scrbl index fe6e75ce48..5d8c02a3b6 100644 --- a/pkgs/racket-doc/scribblings/foreign/types.scrbl +++ b/pkgs/racket-doc/scribblings/foreign/types.scrbl @@ -938,7 +938,21 @@ A @tech{custom function type} that is a marker for expressions that should not be sent to the foreign function. Use this to bind local values in a computation that is part of an ffi wrapper interface, or to specify wrapper arguments that are not sent to the foreign function -(e.g., an argument that is used for processing the foreign output).} +(e.g., an argument that is used for processing the foreign output). + +Examples: + +@racketblock[ +(_fun _? (code:comment "not sent to foreign function") + _int -> _int) +(_fun [init : _?] (code:comment "init is used for pre-processing") + [boxed : (_box _int) = (box init)] + -> _void) +(_fun [offset : _?] (code:comment "offset is used for post-processing") + -> [res : _int] + -> (+ res offset)) +] +} @defform/subs[#:literals (i o io)