From 28dd2b967cc9853d034d2374e4f1adbe305fef8a Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Thu, 6 Feb 2014 10:42:58 -0800 Subject: Racket: Make 'report-name-base' optional in calls to 'call-with-tracer' --- bindings/racket/manual.scrbl | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'bindings/racket/manual.scrbl') diff --git a/bindings/racket/manual.scrbl b/bindings/racket/manual.scrbl index f27731b..2938965 100644 --- a/bindings/racket/manual.scrbl +++ b/bindings/racket/manual.scrbl @@ -110,21 +110,29 @@ ppamltracer is fundamentally a set of stateful operations; the @racket[tracer] d Evaluates to @racket[#t] if and only if @racket[obj] is a @racket[tracer]. } -@defproc[(call-with-tracer [report-name-base path-string?] - [proc (-> tracer? A)]) - A]{ +@defproc*[([(call-with-tracer [proc (-> tracer? A)]) + A] + [(call-with-tracer [report-name-base path-string?] + [proc (-> tracer? A)]) + A])]{ Creates a new @racket[tracer]. - The @racket[tracer] will save trace reports in Open Trace Format; all trace file paths will begin with @racket[report-name-base]. + The @racket[tracer] will save trace reports in Open Trace Format. + Should @racket[report-name-base] be specified, all trace file paths will begin with @racket[report-name-base]; otherwise, all trace file paths will begin with the contents of the environment variable @envvar{PPAMLTRACER_TRACE_BASE}. + + Invoking @racket[call-with-tracer] without specifying @racket[report-name-base] is an error if @envvar{PPAMLTRACER_TRACE_BASE} is undefined. + Doing so will cause Racket to throw (a sub-exception of) @racket[exn:fail:ppamltracer:configuration]. } -@defform[#:id let/tracer - #:literals (tracer) - (let/tracer [tracer report-name-base] body ...) - #:contracts ([report-name-base path-string?])]{ +@defform*[#:id let/tracer + #:literals (tracer) + [(let/tracer [tracer] body ...) + (let/tracer [tracer report-name-base] body ...)] + #:contracts ([report-name-base path-string?])]{ Macro version of @racket[call-with-tracer]. - Equivalent to + Equivalent to one of @racketblock[ + (call-with-tracer (lambda (tracer) body ...)) (call-with-tracer report-name-base (lambda (tracer) body ...)) ] } -- cgit v1.2.3