fix rendering of example in Guide
closes PR 13517
This commit is contained in:
parent
db0234fb6f
commit
4494788017
|
@ -29,11 +29,13 @@
|
|||
(define-syntax-rule (provide-styling id ...)
|
||||
(provide/contract [id styling-f/c] ...))
|
||||
(provide-styling racketmodfont racketoutput
|
||||
racketerror racketfont racketvalfont racketresultfont racketidfont racketvarfont
|
||||
racketerror racketfont racketvalfont racketidfont racketvarfont
|
||||
racketcommentfont racketparenfont racketkeywordfont racketmetafont
|
||||
onscreen defterm filepath exec envvar Flag DFlag PFlag DPFlag math
|
||||
procedure
|
||||
indexed-file indexed-envvar idefterm pidefterm)
|
||||
(provide
|
||||
(contract-out [racketresultfont (->* () (#:decode? boolean?) #:rest (listof pre-content?) element?)]))
|
||||
(define-syntax-rule (provide-scheme-styling [rid sid] ...)
|
||||
(provide/contract [rename rid sid styling-f/c] ...))
|
||||
(provide-scheme-styling [racketmodfont schememodfont]
|
||||
|
@ -91,8 +93,8 @@
|
|||
(apply tt str))
|
||||
(define (racketvalfont . str)
|
||||
(make-element value-color (decode-content str)))
|
||||
(define (racketresultfont . str)
|
||||
(make-element result-color (decode-content str)))
|
||||
(define (racketresultfont #:decode? [decode? #t] . str)
|
||||
(make-element result-color (if decode? (decode-content str) str)))
|
||||
(define (racketidfont . str)
|
||||
(make-element symbol-color (decode-content str)))
|
||||
(define (racketvarfont . str)
|
||||
|
|
|
@ -64,11 +64,11 @@ a pair, but @italic{is not} a list:
|
|||
@interaction[(cons 0 (cons 1 2))]
|
||||
|
||||
In general, the rule for printing a pair is as follows: use the dot
|
||||
notation always, but if the dot is immediately followed by an open
|
||||
parenthesis, then remove the dot, the open parenthesis, and the
|
||||
matching close parenthesis. Thus, @racketresultfont{'(0 . (1 . 2))}
|
||||
notation unless the dot is immediately followed by an open
|
||||
parenthesis. In that case, remove the dot, the open parenthesis, and the
|
||||
matching close parenthesis. Thus, @racketresultfont[#:decode? #f]{'(0 . (1 . 2))}
|
||||
becomes @racketresult['(0 1 . 2)], and
|
||||
@racketresultfont{'(1 . (2 . (3 . ())))} becomes @racketresult['(1 2 3)].
|
||||
@racketresultfont[#:decode? #f]{'(1 . (2 . (3 . ())))} becomes @racketresult['(1 2 3)].
|
||||
|
||||
@;------------------------------------------------------------------------
|
||||
@section[#:tag "quoting-lists"]{Quoting Pairs and Symbols with @racket[quote]}
|
||||
|
|
|
@ -446,8 +446,11 @@ Racket. This procedure is useful for typesetting things like
|
|||
@defproc[(racketvalfont [pre-content pre-content?] ...) element?]{Like
|
||||
@racket[racketfont], but colored as a value.}
|
||||
|
||||
@defproc[(racketresultfont [pre-content pre-content?] ...) element?]{Like
|
||||
@racket[racketfont], but colored as a REPL result.}
|
||||
@defproc[(racketresultfont [#:decode? decode? boolean? #t] [pre-content pre-content?] ...) element?]{
|
||||
Like @racket[racketfont], but colored as a REPL result when @racket[decode?] is
|
||||
@racket[#t]. When @racket[decode?] is @racket[#f], it also avoids @racket[decode]ing
|
||||
its argument.
|
||||
}
|
||||
|
||||
@defproc[(racketidfont [pre-content pre-content?] ...) element?]{Like
|
||||
@racket[racketfont], but colored as an identifier.}
|
||||
|
|
Loading…
Reference in New Issue
Block a user