Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/grafcube/racket-string-interpolation

Racket package for string interpolation syntax in string literals.
https://github.com/grafcube/racket-string-interpolation

package racket racket-lang racket-language racket-library string-formatting string-interpolation

Last synced: about 1 month ago
JSON representation

Racket package for string interpolation syntax in string literals.

Awesome Lists containing this project

README

        

# string-interpolation for Racket

This package adds string interpolation to Racket string literals.

Based on [this comment](https://news.ycombinator.com/item?id=14242481#14244305).
Modified to also have escape syntax.

Use racket in strings with the `"@{}"` syntax.

```racket
#lang racket

(require string-interpolation)

(define (greet name) "Hello @{name}")
(greet "Racket")
```

This results in `"Hello Racket"`.

You can escape this with the `"@\{}"` syntax.

```racket
#lang racket

(require string-interpolation)

(define (greet name) "Hello @\\{name}")
(greet "Racket")
```

This results in `"Hello @{name}"`.