▼ |  | M1 Manual All-Styles Document

1 | Code Styles
2 | Definition Blocks
3 | bitmap-dc%
4 | Miscellaneous
5 | Bibliography
| Bibliography

top ← prev up next →

### 2`` Definition Blocks

(require racket/base) | package: base

The module-declaration box above is in a defmodule table. The package-specification part is in an RpackageSpec wrapper.

The definitions below are marked so that they are not link targets. If they were link targets, the table-of-contents panel on the left would have entries for them.

> > procedure
> > (cons |  | really-long-name-for-the-first-argument |  |  |  |
> > |  | really-long-name-for-the-second-argument) |  | → |  | pair?
> really-long-name-for-the-first-argument : any/c
> | really-long-name-for-the-second-argument |  | : |  |
> (or/c any/c
> any/c)

This definition box starts with a SVInsetFlow wrapper, which is a scribble/base style class for the 'vertical-inset style name on a block; it should give the block suitable vertical space before and after.

The next layer is a boxed plus RBoxed table. The boxed style class is from scribble/base and the 'boxed style name on a table. The RBoxed style class is from the scribble/manual layer. Both boxed and RBoxed are used for all definition boxes by scribble/manual forms.

The initial content of the table includes a SubFlow (a scribble/base style class for non-indented flow) to combine blocks for the background label with the first line of the table. The background label “procedure” has an RBackgroundLabel outer wrapper, which makes the label float right. (The wrapper also has the SIEHidden style class, which built-in for all Scribble HTML output and makes the label hidden on Internet Explorer 6 and earlier.) The background label has an RBackgroundLabelInner inner wrapper, which makes the label suitably faint. The content part of the first line is wrapped in RForeground, which ensures that it is in front of the background label.

In a procedure definition box:

- When the initial “prototype” call in the definition box spans multiple lines, the table that contains the call has the prototype style class in addition to RForeground.

- When the contract or default value for an argument spans multiple lines, then the contract, the “=” for a value (if any), and value (if any) are wrapped in an table with the argcontract style class.

Finally, the definition box and all of the associated explanation text are wrapped in SIntrapara blocks and grouped into a single <p>.

> syntax (lambda ...)
> example |  | = |  | good
> |  | | |  | bad

When a syntactic-from specification has a grammar, the grammar is in a table with the specgrammar style class.

Since no explanation flow is attached to the above defform use, there’s no SIntrapara block around the table (just a <p>).

> procedure (cons a d) → pair?
> a : any/c
> d : any/c
> syntax (lambda ...)

Putting definitions together with deftogether converts the RBoxed and boxed tables that would be generated for the individual definitions into tables with the together style class. The tables are then combined as rows in a new table with the RBoxed and boxed style classes.

A defsubform, specsubform, etc., such as

> > (lambda ...)

is indented though a wrapper with a leftindent style class.

top ← prev up next →