# Syntax Colours for Custom Dispatch Macros

**URL:** https://racket.discourse.group/t/syntax-colours-for-custom-dispatch-macros/3714
**Category:** Questions & Answers
**Created:** [May 3, 2025, 9:22am UTC](https://racket.discourse.group/t/syntax-colours-for-custom-dispatch-macros/3714 "2025-05-03T09:22:58Z")
**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: [May 3, 2025, 9:22am UTC](https://racket.discourse.group/t/syntax-colours-for-custom-dispatch-macros/3714/1 "2025-05-03T09:22:58Z")

</div>

Hi, Racket Discourse.

I wanted to try my hand at writing a reader macro extension, which was less intimidating than I thought it would be.

The result works, but I am curious where I would implement custom syntax colours for such macros. I have had a quick look at the `info.rkt` for the Dracula theme, for example, but it's not clear to me where, if at all, this modification would fit.

```scheme
#lang reader "iverson-racket.rkt"

;; I recently encountered the "Iverson Bracket" again, and
;; it seemed like an easy goal to try and implement (so named after the "Kronecker delta")

(define ≤ <=)

(define (Max x y)
  (+ (* x #δ(> x y))
     (* y #δ(≤ x y))))

(define (Min x y)
  (+ (* x #δ(≤ x y))
     (* y #δ(> x y))))

(define (Sgn x)
  (- #δ(positive? x)
     #δ(negative? x)))

(Min 1 2) ;=> 1
(Max 1 2) ;=> 2

(Sgn 100) ;=> +1
(Sgn -20) ;=> -1

(require
  math/number-theory)

(define (φ n)
  (for/sum ([i (in-range 1 n)])
    #δ(= 1 (gcd n i))))

(φ 11) ;=> 10

```

At the moment, `#δ` is coloured red, like so:  
 ![image](https://global.discourse-cdn.com/free1/uploads/racket/original/2X/b/b633a310312b8306bb5b19c0a576c84a50c9f6d3.png)

* * *

P.S. for the curious _reader_ (haha):

> <https://gist.github.com/bakgatviooldoos/3df828ed4cbd015276c56fd6e725d16f>
>
> There are more than three files. show original
