commit 38a0fcf853b17eb1e7ac85b021ad33b710abad49
parent ad769b47676704bb29040e7351e6179df68b706b
Author: Eli Barzilay <eli@racket-lang.org>
Date: Thu, 16 Jul 2009 12:21:52 +0000
prefix -> add-prefix
svn: r15456
original commit: 19462e97c4b3ec173c6f843bc5c5127c1ec9732f
Diffstat:
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/collects/scribble/text/output.ss b/collects/scribble/text/output.ss
@@ -137,7 +137,7 @@
(set-mcar! pfxs npfx) (set-mcdr! pfxs 0)
(for-each loop c)
(set-mcar! pfxs pfx) (set-mcdr! pfxs lpfx))]
- [(prefix) ; maybe call this `add-prefix'?
+ [(add-prefix)
(let* ([pfx (mcar pfxs)] [lpfx (mcdr pfxs)]
[npfx (pfx+ (pfx+col (pfx+ pfx lpfx)) (car c))])
(set-mcar! pfxs npfx) (set-mcdr! pfxs 0)
@@ -199,7 +199,7 @@
(define/provide-special flush)
(define/provide-special (disable-prefix))
(define/provide-special (restore-prefix))
-(define/provide-special (prefix pfx))
+(define/provide-special (add-prefix pfx))
(define/provide-special (set-prefix pfx))
(define/provide-special (with-writer writer))
diff --git a/collects/scribblings/scribble/preprocessor.scrbl b/collects/scribblings/scribble/preprocessor.scrbl
@@ -802,14 +802,14 @@ already beyond it).
}-|
There are cases where each line should be prefixed with some string
-other than a plain indentation. The @scheme[prefix] function causes
-its contents to be printed using some given string prefix for every
-line. The prefix gets accumulated to an existing indentation, and
-indentation in the contents gets added to the prefix.
+other than a plain indentation. The @scheme[add-prefix] function
+causes its contents to be printed using some given string prefix for
+every line. The prefix gets accumulated to an existing indentation,
+and indentation in the contents gets added to the prefix.
@example|-{#lang scribble/text
@(define (comment . body)
- @prefix["// "]{@body})
+ @add-prefix["// "]{@body})
@comment{add : int int -> string}
char *foo(int x, int y) {
@comment{
@@ -835,16 +835,16 @@ indentation in the contents gets added to the prefix.
}
}-|
-When combining @scheme[prefix] and @scheme[disable-prefix] there is an
-additional value that can be useful: @scheme[flush]. This is a value
-that causes @scheme[output] to print the current indentation and
+When combining @scheme[add-prefix] and @scheme[disable-prefix] there
+is an additional value that can be useful: @scheme[flush]. This is a
+value that causes @scheme[output] to print the current indentation and
prefix. This makes it possible to get the ``ignored as a prefix''
property of @scheme[disable-prefix] but only for a nested prefix.
@example|-{#lang scribble/text
@(define (comment . text)
(list flush
- @prefix[" *"]{
+ @add-prefix[" *"]{
@disable-prefix{/*} @text */}))
function foo(x) {
@comment{blah
@@ -883,7 +883,7 @@ property of @scheme[disable-prefix] but only for a nested prefix.
;; notes: the `flush' makes the prefix to that point print so the
;; disable-prefix "* " is printed after it, which overwrites the
;; "| " prefix
- (list flush (prefix "| " (disable-prefix "* ") text)))
+ (list flush (add-prefix "| " (disable-prefix "* ") text)))
;; note that a simple item with spaces is much easier:
(define (simple . text) @list{* @text}))