From ec600c59bb9caa15f10fb68844677e56a4ce86dc Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 21 Dec 2008 13:57:46 +0000 Subject: [PATCH] fine-tune typechecking index entry svn: r12920 --- collects/mzlib/foreign.ss | 6 ++++-- collects/scribblings/scribble/basic.scrbl | 8 +++++++- collects/typed-scheme/ts-guide.scrbl | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/collects/mzlib/foreign.ss b/collects/mzlib/foreign.ss index 42a9103364..5c04be9b6d 100644 --- a/collects/mzlib/foreign.ss +++ b/collects/mzlib/foreign.ss @@ -677,9 +677,11 @@ [(_ x ...) (begin (set! xs (syntax->list #'(x ...))) (do-fun))])) (define (function-ptr p fun-ctype) - (if (cpointer? p) + (if (or (cpointer? p) (procedure? p)) (if (eq? (ctype->layout fun-ctype) 'fpointer) - ((ctype-c->scheme fun-ctype) p) + (if (procedure? p) + ((ctype-scheme->c fun-ctype) p) + ((ctype-c->scheme fun-ctype) p)) (raise-type-error 'function-ptr "function ctype" fun-ctype)) (raise-type-error 'function-ptr "cpointer" p))) diff --git a/collects/scribblings/scribble/basic.scrbl b/collects/scribblings/scribble/basic.scrbl index fab7f6089e..d4a6131cb8 100644 --- a/collects/scribblings/scribble/basic.scrbl +++ b/collects/scribblings/scribble/basic.scrbl @@ -189,7 +189,13 @@ strings for a hierarchy, such as @scheme['("strings" "plain")] for a the strings are ``cleaned'' using @scheme[clean-up-index-strings]. The strings (without clean-up) also serve as the text to render in the index. The @tech{decode}d @scheme[pre-content] is the text to appear -inline as the index target.} +inline as the index target. + +Use @scheme[index] when an index entry should point to a specific word +or phrase within the typeset document (i.e., the +@scheme[pre-content]). Use @scheme[section-index], instead, to create +an index entry that leads to a section, instead of a specific word or +phrase within the section.} @defproc[(index* [words (listof string?)] diff --git a/collects/typed-scheme/ts-guide.scrbl b/collects/typed-scheme/ts-guide.scrbl index f662e135cb..079a86fb02 100644 --- a/collects/typed-scheme/ts-guide.scrbl +++ b/collects/typed-scheme/ts-guide.scrbl @@ -14,7 +14,7 @@ @author["Sam Tobin-Hochstadt"] -@index["typecheck"] +@section-index["typechecking"] Typed Scheme is a Scheme-like language, with a type system that supports common Scheme programming idioms. Explicit type declarations