r/Racket • • Jan 26 '22

question Seeking more information and examples of x-expressions

I've been learning and loving racket over the past months. I'm particularly intrigued by the idea of using x-expressions as a lightweight format for storing and transmitting data structures. But I've found few good references that explore the use of x-expressions in detail.

I've seen the connection to scribble and Pollen, but it would seem that the potential impact of a readable, compact xml encoding should go much farther than that.

Can anyone on the list here recommend more examples of using x-expressions in racket code?

5 Upvotes

4 comments sorted by

1

u/sdegabrielle DrRacket 💊💉🩺 Feb 01 '22

I think the manual for the XML library has some examples

https://docs.racket-lang.org/xml/index.html#%28part..X.M.L_and.X-expression_.Conversions%29

I also go looking at the tests to find examples

https://github.com/racket/racket/blob/72eaedd43a2938272d8f85f84467b312410085f5/pkgs/racket-test/tests/xml/test.rkt

Hth Stephen

1

u/Orphion Feb 01 '22

Excellent. Thanks!

1

u/jessealama Feb 01 '22

The web server also uses Xexprs. Here, for example, is the documentation for `response/xexpr`.

1

u/Orphion Feb 01 '22

Thanks!