Racket package for string interpolation syntax in string literals.
https://pkgd.racket-lang.org/pkgn/package/string-interpolation
| .github/workflows | Update CI | |
| scribblings | Add code and docs | |
| .gitignore | Initial commit | |
| info.rkt | Add unit tests | |
| LICENSE-APACHE | Update Licenses | |
| LICENSE-MIT | Update Licenses | |
| main.rkt | Interpolate multiple expressions in a string | |
| README.md | Initial commit | |
string-interpolation for Racket
This package adds string interpolation to Racket string literals.
Based on this comment. Modified to also have escape syntax.
Use racket in strings with the "@{<code>}" syntax.
#lang racket
(require string-interpolation)
(define (greet name) "Hello @{name}")
(greet "Racket")This results in "Hello Racket".
You can escape this with the "@\{<code>}" syntax.
#lang racket
(require string-interpolation)
(define (greet name) "Hello @\\{name}")
(greet "Racket")This results in "Hello @{name}".