change defstruct rendering

This commit is contained in:
Matthew Flatt 2010-04-24 08:29:45 -06:00
parent ee24953dde
commit f60c178964
2 changed files with 22 additions and 14 deletions

View File

@ -1,4 +1,4 @@
#lang scheme/base
#lang racket/base
(require "../decode.ss"
"../struct.ss"
"../scheme.ss"
@ -16,9 +16,9 @@
"on-demand.ss"
scheme/string
scheme/list
(for-syntax scheme/base)
(for-label scheme/base
scheme/class))
(for-syntax racket/base)
(for-label racket/base
racket/class))
(provide defproc defproc* defstruct
defparam defparam* defboolparam
@ -560,11 +560,15 @@
#f))
fields)))))])
(if (pair? name)
(to-element (list just-name
(make-just-context
(cadr name)
(cadr (syntax-e stx-id)))))
just-name))]
(make-element
#f
(list just-name
(hspace 1)
(to-element
(make-just-context
(cadr name)
(cadr (syntax-e stx-id))))))
just-name))]
[short-width
(apply + (length fields) 8
(append
@ -584,14 +588,17 @@
(make-omitable-paragraph
(list
(to-element
`(,(schemeparenfont "struct")
`(,(scheme struct)
,the-name
,(map field-view fields)))))
(make-table
#f
(append
(list
(list (to-flow (schemeparenfont "(struct"))
(list (to-flow (make-element #f
(list
(schemeparenfont "(")
(scheme struct))))
flow-spacer
(to-flow the-name)
(if (or (null? fields)

View File

@ -215,8 +215,9 @@ structure type property's guard, if any).
@defexamples[
#:eval class-eval
(define i (interface* () ([prop:custom-write (lambda (obj port write?) (void))])
method1 method2 method3))
(define i (interface* () ([prop:custom-write
(lambda (obj port write?) (void))])
method1 method2 method3))
]}
@; ------------------------------------------------------------------------
@ -1284,7 +1285,7 @@ renamed, and multiple traits can be merged to form a new trait.
@defform/subs[#:literals (public pubment public-final override override-final overment augment augride
augment-final private inherit inherit/super inherit/inner rename-super
inherit-field)
field inherit-field)
(trait trait-clause ...)
([trait-clause (public maybe-renamed ...)