On this page:
rhombus
rhombusblock
rhombusblock_  etc
rhombus_  typeset
8.15.0.2

3.1 Typesetting Code🔗ℹ

expression

rhombus(group)

 

expression

rhombus(group, builtin_space)

 

expression

rhombus(group, ~at space_name)

 

builtin_space

 = 

~var

 | 

~datum

 | 

~value

 | 

~result

 | 

~expr

 | 

~defn

 | 

~decl

 | 

~bind

 | 

~impo

 | 

~expo

 | 

~modpath

 | 

~annot

 | 

~repet

 | 

~stxclass

 | 

~reducer

 | 

~class

 | 

~space

 | 

~for_clause

 | 

~class_clause

 | 

~interface_clause

 | 

~veneer_clause

 | 

~entry_point

 | 

~unquote_bind

 | 

~syntax_class_clause

 | 

~pattern_clause

 | 

~space_clause

 | 

~space_meta_clause

 | 

~key_comp

 | 

~immediate_callee

 | 

~doc

Typesets group literally as an Element to appear inline in a paragraph. Spacing in group is normalized, instead of preserved exactly as in the source.

Use #,(expr) within group to escape from literal mode and substitute the element produced by expr.

A builtin_space or space name after ~at supplies the initial space to use for creating hyperlinks in group based on meta_label imports.

expression

rhombusblock(group, ...)

Similar to rhombus, but producing a FlowBlock for multiple groups and with whitespace preserved exactly as in the source.

Note that when you use @ notation to call rhombusblock, then no comma is required between groups that are on separate lines. So, for example,

@rhombusblock(

  fun add(x, y):

    x + y

  add(1, 2)

)

renders as

fun add(x, y):

  x + y

add(1, 2)

without adding a comma after the add definition. If the source does contain a comma, then is preserved in the output.

expression

rhombusblock_etc:

  group

  ...

 

expression

rhombusblock_etc(option, ...):

  group

  ...

 

option

 = 

~inset

 | 

~indent

 | 

~prompt

 | 

~indent_from_block

Like rhombusblock, but supports options.

definition

rhombus_typeset 'id':

  body

  ...

Binds id so that when it is used in rhombus or rhombusblock, the use of id is replaced with the result of the body sequence.