[HN Gopher] Code Observation: Clojure's Destructuring
___________________________________________________________________
Code Observation: Clojure's Destructuring
Author : semperos
Score : 61 points
Date : 2021-06-14 11:08 UTC (11 hours ago)
(HTM) web link (danielgregoire.dev)
(TXT) w3m dump (danielgregoire.dev)
| eatonphil wrote:
| Interesting use of <details> to show the results of a
| computation. I missed the explanation in the beginning that said
| the results were precomputed. I thought clicking it was running.
| Format-wise since it's not actually running when clicked, I'm not
| sure hiding the result behind <details> is much clearer than just
| including the result as displayed by the REPL in the same
| snippet.
| Fellshard wrote:
| As a flipside argument, it may be useful in an article like
| this to help people test their own intuition on what a piece of
| code will do.
| macintux wrote:
| This functionality in Erlang is something I miss in most other
| languages, and I was quite displeased when I discovered Python 3
| abandoned tuple destructuring in function invocations.
| whalesalad wrote:
| The destructuring abilities of Javascript are something I
| regularly miss in Python, especially when I am hacking on a
| polyglot project with a JS frontend and a Py backend.
| lmilcin wrote:
| I don't know Erlang but I also found Clojure's destructuring to
| be an extremely useful tool. For me it allowed developing
| useful project idioms that can be very effective in cutting a
| lot of boilerplate.
___________________________________________________________________
(page generated 2021-06-14 23:01 UTC)