# Auto Rename Transformers

**URL:** <https://racket.discourse.group/t/auto-rename-transformers/3671>\
**Category:** Show & Tell\
**Created:** [April 1, 2025, 7:26pm UTC](https://racket.discourse.group/t/auto-rename-transformers/3671 "2025-04-01T19:26:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eutro](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/eutro/32/2275_2.png) [@Eutro](https://racket.discourse.group/u/Eutro)\
**Post date:** [April 1, 2025, 7:26pm UTC](https://racket.discourse.group/t/auto-rename-transformers/3671/1 "2025-04-01T19:26:10Z")

</div>

Have you ever been frustrated with the naming conventions of libraries? Perhaps you are a British person frustrated with programming norms that dictate the use of incorrectly-spelled words like `color` and `normalize`? Perhaps you want to import all of [racket/unsafe/ops](https://docs.racket-lang.org/reference/unsafe.html) but don't want to type out `unsafe-` for every binding? Ou peut-être que tu veux simplement écrire tous vos programmes en mauvais franćais. In any case, this is the package for you!

With `auto-rename` you can filter, rename, and duplicate bindings in `provide` or `require` to your heart's content.

```scheme
(module fancy-lib racket
  (provide (all-defined-out))
  (struct fancy (x y z) #:transparent))

> (require auto-rename) 
> (require (transform-in 'fancy-lib #:tx (tx/replace "fancy" "not-so-fancy")))
> (not-so-fancy 1 2 3)
(fancy 1 2 3)
> struct:not-so-fancy
#<struct-type:fancy>

> (require (transform-in racket/unsafe/ops #:tx (tx/replace #rx"-?unsafe-?" "")))
> (fx+ 1234 6876)
8110
> (fx+ null 2)
#<eof>

```

With internationalisation support, you can even write Racket programs in your favourite natural language\[1\] using `auto-rename/language/british-english`:

```scheme
> (require auto-rename/language/british-english
           (for-british racket))
> (normalise-arity 1)
1
> (rationalise 1/4 1/10)
1/3
> (parameterise ([error-print-width 5])
    (car (expt 10 1024)))
car: contract violation
  expected: pair?
  given: 10...
> (string-normalise-spaces " foo bar baz \r\n\t")
"foo bar baz"

```

or `auto-rename/language/polyglot`:

```scheme
> (require auto-rename/language/polyglot)
> (require (en-français racket racket/generator))
> (se-dresser inconvénients nul (liste 1 2 3))
'(3 2 1)
> (|jeter-un-coup-d'œil-octets| 4 0 (ouvrir-saisir-chaîne "abcd"))
#"abcd"
> (exiger (auf-deutsch racket))
> (sogar? (länge (nachteile 0 (nachteile 1 null))))
#t
> (lassen-werte ([(rohr-ein rohr-aus) (machen-rohr)])
    (schreiben-saite (saite-oben "efgh\nijkl") rohr-aus)
    (schließen-ausgabe-hafen rohr-aus)
    (beginnen0
      (hafen->linien rohr-ein)
      (schließen-eingang-hafen rohr-ein)))
'("EFGH" "IJKL")
> (erfordern (magyarul racket racket/generator))
> (meghatároz funkció
    (ügy-lambda
     [() (hozam 1) (hozam 2) (hozam 3)]
     [(x y) (hányados/maradék x y)]))
> (funkció 100 7)
14
2

```

Try it out today! Available with [`raco pkg install auto-rename`](https://pkgd.racket-lang.org/pkgn/package/auto-rename).

* * *

1. If that language is British English, French, German, or Hungarian.

---

<div class="post-metadata">

**Author:** ![damien\_mattei](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/damien_mattei/32/2706_2.png) [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Post date:** [April 2, 2025, 6:43pm UTC](https://racket.discourse.group/t/auto-rename-transformers/3671/2 "2025-04-02T18:43:39Z")

</div>

Hi @Eutro ,

> [@Eutro](#):
>
> Ou peut-être que tu veux simplement écrire tous vos programmes en mauvais franćais.

i'm not really competent with your code that should be fine but as French i will have wrote "Ou peut-être que vous voulez simplement écrire tous vos programmes en mauvais français." 🙂
