From e163a57a2ab47e1d281ab5739f868033aac20a76 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Wed, 22 Jun 2011 12:39:33 -0400 Subject: [PATCH] Document #% forms. original commit: 9dde2a6d39a8e80a48425571cc1cc0f1a0672406 --- .../scribblings/reference/special-forms.scrbl | 23 ++++++++++++++++--- .../scribblings/ts-reference.scrbl | 3 --- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/collects/typed-scheme/scribblings/reference/special-forms.scrbl b/collects/typed-scheme/scribblings/reference/special-forms.scrbl index 37292f81..a7ddcece 100644 --- a/collects/typed-scheme/scribblings/reference/special-forms.scrbl +++ b/collects/typed-scheme/scribblings/reference/special-forms.scrbl @@ -13,13 +13,14 @@ (examples #:eval the-top-eval . args)) -@(define-syntax-rule (def-racket for-id for*-id with-handlers-id) +@(define-syntax-rule (def-racket for-id for*-id with-handlers-id mod-beg-id) (begin - (require (for-label (only-in racket/base for for* with-handlers))) + (require (for-label (only-in racket/base for for* with-handlers #%module-begin))) (define for-id (racket for)) (define for*-id (racket for*)) + (define mod-beg-id (racket #%module-begin)) (define with-handlers-id (racket with-handlers)))) -@(def-racket for-id for*-id with-handlers-id) +@(def-racket for-id for*-id with-handlers-id mod-beg-id) @title[#:tag "special-forms"]{Special Form Reference} @@ -387,4 +388,20 @@ so we need to use @racket[case->].} Identical to @|with-handlers-id|, but provides additional annotations to help the typechecker. } +@defform[(#%module-begin form ...)]{ + +Legal only in a @rtech{module begin context}. +The @racket[#%module-begin] form of @racketmodname[typed/racket] checks all the +forms in the module, using the Typed Racket type checking rules. All +@racket[provide] forms are rewritten to insert contracts where appropriate. +Otherwise, the @racket[#%module-begin] form of @racketmodname[typed/racket] +behaves like @|mod-beg-id| from @racketmodname[racket].} + +@defform[(#%top-interaction . form)]{ + +Performs type checking of forms entered at the read-eval-print loop. The +@racket[#%top-interaction] form also prints the type of @racket[form] after +type checking.} + + @(close-eval the-eval) diff --git a/collects/typed-scheme/scribblings/ts-reference.scrbl b/collects/typed-scheme/scribblings/ts-reference.scrbl index d11a23cf..f89407c4 100644 --- a/collects/typed-scheme/scribblings/ts-reference.scrbl +++ b/collects/typed-scheme/scribblings/ts-reference.scrbl @@ -1,8 +1,5 @@ #lang scribble/manual -@begin[(require "utils.rkt") - (require (for-label (only-meta-in 0 [except-in typed/racket for])))] - @title[#:tag "top"]{The Typed Racket Reference} @author[@author+email["Sam Tobin-Hochstadt" "samth@racket-lang.org"]