# Documenting struct in Scribble

**URL:** <https://racket.discourse.group/t/documenting-struct-in-scribble/2618>\
**Category:** Questions & Answers\
**Tags:** question, scribble\
**Created:** [December 24, 2023, 9:18am UTC](https://racket.discourse.group/t/documenting-struct-in-scribble/2618 "2023-12-24T09:18:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PLux55](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/plux55/32/1611_2.png) [@PLux55](https://racket.discourse.group/u/PLux55)\
**Post date:** [December 24, 2023, 9:18am UTC](https://racket.discourse.group/t/documenting-struct-in-scribble/2618/1 "2023-12-24T09:18:43Z")

</div>

How do you document a field of a struct which has a #:mutable option. There is nothing about this in the documentation. I'm running racket 8.7.

---

<div class="post-metadata">

**Author:** ![shhyou](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@shhyou](https://racket.discourse.group/u/shhyou)\
**Post date:** [December 24, 2023, 2:26pm UTC](https://racket.discourse.group/t/documenting-struct-in-scribble/2618/2 "2023-12-24T14:26:42Z")

</div>

Looks like this is not documented but available:

Source code: [https://github.com/racket/games/blob/eba5c6fa54c524871badb8b0e205fe37640d6c3e/cards/cards.scrbl#L60](https://github.com/racket/games/blob/eba5c6fa54c524871badb8b0e205fe37640d6c3e/cards/cards.scrbl#L60)

> ```scheme
> @defstruct[region ([x real?]
> ...
> [(callback #:mutable)
> (or/c #f (if button?
> (-> any)
> (-> (listof (is-a?/c card<%>)) any)))]
> ...
> 
> ```

Rendered: [https://docs.racket-lang.org/cards/index.html#(def.\_((lib.\_games%2Fcards..rkt).\_region))](https://docs.racket-lang.org/cards/index.html#%28def._%28%28lib._games%2Fcards..rkt%29._region%29%29)

---

<div class="post-metadata">

**Author:** ![shhyou](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@shhyou](https://racket.discourse.group/u/shhyou)\
**Post date:** [January 4, 2024, 10:12pm UTC](https://racket.discourse.group/t/documenting-struct-in-scribble/2618/3 "2024-01-04T22:12:13Z")

</div>

PR opened for the doc edits.

> <https://github.com/racket/scribble/pull/401>
>
> The \`defstruct\[\*\]\` form does support field options. Therefore use the same gramm…ar as \[\`\[define-\]struct\`\](https://docs.racket-lang.org/reference/define-struct.html#%28form.\_%28%28lib.\_racket%2Fprivate%2Fbase..rkt%29.\_struct%29%29) in the documentation.
