; input is JSON string: "{foo: 2}"
(defn xform [s]
(-> (js/JSON.parse s)
js->clj
(update "foo" + 2)
clj->js
js/JSON.stringify))
Racket equivalent: #lang racket
(require threading json)
; input is (xform "{\"foo\" : 2 }")
(define (xform s)
(~> s
string->jsexpr
(hash-update 'foo (λ (x) (+ 2 x)))
jsexpr->string)) Welcome to DrRacket, version 6.12 [3m].
Language: racket, with debugging.
> (cons 'foo 'bar)
'(foo . bar)
Similarly, full Racket has multiple, powerful macro systems, and more besides, deliberately excluded from the Teaching Languages.
Beating the averages: http://www.paulgraham.com/avg.html
Racket web frameworks: https://github.com/avelino/awesome-racket#web-frameworks