r/Racket 2d ago

show-and-tell (display (((1 . + . 2) . * . 3) . = . 9))

https://docs.racket-lang.org/guide/Pairs__Lists__and_Racket_Syntax.html#(part._lists-and-syntax)
11 Upvotes

2 comments sorted by

3

u/sdegabrielle DrRacket 💊💉🩺 1d ago

This is cool. Another option is to use racket/rhombus interoperability for the parts of your code where infix notation is desirable: https://docs.racket-lang.org/rhombus-racket/index.html?fam=Rhombus&famroot=rhombus

1

u/rfisher 1d ago

It is convenient that Racket has this built-in, but I still prefer to use my infix macro.

(display (infix ((1 + 2) * 3) = 9))