# What are some Syntax Class idioms that you enjoy?

**URL:** <https://racket.discourse.group/t/what-are-some-syntax-class-idioms-that-you-enjoy/3244>\
**Category:** General\
**Tags:** syntax-class\
**Created:** [October 21, 2024, 8:32am UTC](https://racket.discourse.group/t/what-are-some-syntax-class-idioms-that-you-enjoy/3244 "2024-10-21T08:32:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bakgatviooldoos](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/bakgatviooldoos/32/1381_2.png) [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)\
**Post date:** [October 21, 2024, 8:32am UTC](https://racket.discourse.group/t/what-are-some-syntax-class-idioms-that-you-enjoy/3244/1 "2024-10-21T08:32:26Z")

</div>

Hi, Racket Discourse.

What kinds of idioms do you enjoy using when writing syntax classes for `syntax-parse` and friends?

I stumbled on this nice little turn of phrase for a choice from a group of options:

```scheme
(pattern (@ (~or β:bag-expr
                 α:atom-expr
                 ρ:raise-expr
                 μ:merge-expr)
            (~optional ?expt:expt-expr))
  ; al die eendjies stap in 'n ry
  #:with bag? #'(~? β.here
                (~? μ.here
                (~? ρ.bag? #false)))
  #:with base #'(~? β.wrap
                (~? μ.wrap
                (~? ρ.base α.self)))
  #:with expt #'(* (~? ρ.expt) (~? ?expt.term 1)))

```

I don't know if this is achieved more easily by some other form, but it has a charm to it.
