Woah, just found out that Clojure 1.12 supports the 'UNO Reverse' syntax which allows you to swap the lexical order of bindings:
(let [┏━━━━━━━━━▶ :━┓
┃ 123 x ┃
┃ (inc x) foo ┃
┗━ :◀━━━━━━━━━┛]
foo)
;; => 124
seems like a pretty niche feature, but I'm sure there are situations where it can help with code clarity~Can anybody explain me what you are talking about?
run the code linked in the original message
formatting messaged up due to the indentation of the repl prompt but you get the idea
So the following code is legal, and I think perfectly understandable Clojure code: (let [a (inc foo 1) b (* a 2)] <body here>) . You can use a in a later expression of the let. Identifiers are usually combinations of letters, digits, and dashes, but Clojure allows other characters like | and other "ASCII art" characters are legal in identifier names, too.
This thread is discussing that it is legal Clojure to do some pretty strange things with ASCII art characters in a let statement, that I personally consider confusing and obfuscating, but others find intriguing and possibly useful.
In case it wasn't clear, my original comments were entirely tongue-in-cheek with the intention to baffle and bewilder :)
but... if anyone has the urge to use this 'feature' in production code, I'd recommend using [Swearjure](https://hypirion.com/musings/swearjure) instead, much more elegant
Unless this actually somehow became common usage, which seems unlikely, this seems like the opposite of a way of writing source code that can help with code clarity. It looks more like intentional obfuscation.
i am unable to parse this out
that's amazing.
(->> '[┏━━━━━━━━━:arrow_forward: :━┓
┃ 123 x ┃
┃ (inc x) foo ┃
┗━ ::arrow_backward:━━━━━━━━━┛]
(partition 2))
;;=> ((┏━━━━━━━━━:arrow_forward: :━┓) (┃ 123) (x ┃) (┃ (inc x)) (foo ┃) (┗━ ::arrow_backward:━━━━━━━━━┛))(let [┃ 123
x ┃
┃ (inc x)
foo ┃]
foo)wow that's cursed and amazing
heh Slack's code block display spoils the magic a little by breaking up the lines between the box drawing chars, it looks more convincing if they're all joined up:
this is such a cool party trick of racket
yep I was directly inspired by that! started writing an experimental macro before realising it was way too much work trying to tokenize all those symbols
i didn’t even consider that this was valid code at first. it’s a really great snippet
Just saw a post where a lot of people said they got into programming using this flask tutorial: https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world Just thought I'd leave it here, as I find it interesting to see what kind of material is successful to help people learn programming or a language.
I'll check this out. It looks like a neat resource!
Would be awesome to have something like this with Clojure and Datomic. Personally, I really struggled to map the official documentation to do this kind of projects everyone wants to do, would be WAY easier with tutorials that do the usual projects. Plus, in there we could include the particular approach to problems plus the REPL experience from Clojure. @lorilynjmiller