diff --git a/collects/scribble/html-render.ss b/collects/scribble/html-render.ss
index fe8f4525..fddce7da 100644
--- a/collects/scribble/html-render.ss
+++ b/collects/scribble/html-render.ss
@@ -130,7 +130,8 @@
`((,(case (length number)
[(0) 'h2]
[(1) 'h3]
- [else 'h4])
+ [(2) 'h4]
+ [else 'h5])
,@(format-number number '((tt nbsp)))
,@(if (part-tag d)
`((a ((name ,(format "~a" `(part ,(part-tag d)))))))
diff --git a/collects/scribble/manual.ss b/collects/scribble/manual.ss
index d01ed7af..521add3b 100644
--- a/collects/scribble/manual.ss
+++ b/collects/scribble/manual.ss
@@ -180,7 +180,8 @@
;; ----------------------------------------
- (provide defproc defproc* defstruct defthing defform defform* defform/subs defform*/subs defform/none
+ (provide defproc defproc* defstruct defthing defparam
+ defform defform* defform/subs defform*/subs defform/none
specform specform/subs
specsubform specsubform/subs specspecsubform specspecsubform/subs specsubform/inline
schemegrammar schemegrammar*
@@ -240,8 +241,10 @@
(lambda () (list desc ...)))]))
(define-syntax defstruct
(syntax-rules ()
+ [(_ name fields #:immutable desc ...)
+ (*defstruct (quote-syntax name) 'name 'fields #t (lambda () (list desc ...)))]
[(_ name fields desc ...)
- (*defstruct (quote-syntax name) 'name 'fields (lambda () (list desc ...)))]))
+ (*defstruct (quote-syntax name) 'name 'fields #f (lambda () (list desc ...)))]))
(define-syntax (defform*/subs stx)
(syntax-case stx ()
[(_ #:literals (lit ...) [spec spec1 ...] ([non-term-id non-term-form ...] ...) desc ...)
@@ -342,6 +345,10 @@
(syntax-rules ()
[(_ id result desc ...)
(*defthing (quote-syntax id) 'id 'result (lambda () (list desc ...)))]))
+ (define-syntax defparam
+ (syntax-rules ()
+ [(_ id arg contract desc ...)
+ (defproc* ([(id) contract] [(id [arg contract]) void?]) desc ...)]))
(define-syntax schemegrammar
(syntax-rules ()
[(_ #:literals (lit ...) id clause ...) (*schemegrammar '(lit ...)
@@ -587,7 +594,7 @@
(map symbol->string (car wrappers)))))))
(cdr wrappers))))
- (define (*defstruct stx-id name fields content-thunk)
+ (define (*defstruct stx-id name fields immutable? content-thunk)
(define spacer (hspace 1))
(make-splice
(cons
@@ -613,10 +620,13 @@
(map (lambda (f)
(list name '- (car f)))
fields)
- (map (lambda (f)
- (list 'set- name '- (car f) '!))
- fields)))))
- ,(map car fields))))))))
+ (if immutable?
+ null
+ (map (lambda (f)
+ (list 'set- name '- (car f) '!))
+ fields))))))
+ ,(map car fields)
+ ,@(if immutable? '(#:immutable) null))))))))
(map (lambda (v)
(cond
[(pair? v)
diff --git a/collects/scribble/scheme.ss b/collects/scribble/scheme.ss
index c820bad7..c762f205 100644
--- a/collects/scribble/scheme.ss
+++ b/collects/scribble/scheme.ss
@@ -111,7 +111,7 @@
(define advance
(case-lambda
[(c init-line! delta)
- (let ([c (+ delta (syntax-column c))]
+ (let ([c (+ delta (or (syntax-column c) 0))]
[l (syntax-line c)])
(let ([new-line? (and l (l . > . line))])
(when new-line?
diff --git a/collects/scribble/scribble.css b/collects/scribble/scribble.css
index 887ca883..2310f499 100644
--- a/collects/scribble/scribble.css
+++ b/collects/scribble/scribble.css
@@ -69,10 +69,6 @@
margin-right: 0em;
}
- h1,h2,h3,h4,h5,h6 {
- margin-top: .5em;
- }
-
.toclink {
text-decoration: none;
color: blue;