summaryrefslogtreecommitdiff
path: root/antiformatter/README.md
blob: 1eac8b19a662144b6eae0bf1f32d7b08b4c1b766 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# antiformatter: attempting to make the worst possible passable racket code

usage: `racket antifmt.rkt <file>`

regular racket code. boring to read, easy on the eyes. booooooo
```rkt
(define (mangle sexp)
  (if (not (list? sexp)) (error 'mangle "not an s-exp")
    (if (empty? sexp) ""
      (let ((paren (random-paren)))
        (string-append
          (first paren)
          (mangle-params sexp)
          (random-newline)
          (last paren))))))
```

anti-formatted racket code. exciting! an adventure to understand! still compiles (usually)
```rkt
[define [mangle sexp

] [if (not [list? sexp
] ) [error {quote mangle } "not an s-exp"
] (if {empty? sexp

} "" [let {{paren {random-paren
}
}
} [string-append {first paren } (mangle-params sexp

) {random-newline } [last paren ] ]
]

)

]
]
```