Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
Rich Hickey • 3 years ago
Sorry, I have to disagree with the entire premise here.
A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.
Mastery comes from a combination of at least several of the following:
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
- Stores data elements based on an sequential, most commonly 0 based, index.
- Based on tuples from set theory.
from http://www.linuxjournal.com/article/10708
DE: What did you do before you started the Clojure project?
RH: I'm a consultant, so I work on various things. I think the big thing I've done recently is I worked on the national exit poll.
DE: What other languages did you use before inventing your own?
#!/usr/bin/env lumo | |
(ns spacedl.spacedl | |
(:require [cljs.nodejs :as node] | |
[clojure.pprint :refer [pprint]] | |
[clojure.string :as string :refer [join split starts-with?]] | |
[cljs.core :refer [*command-line-args*]])) | |
(node/enable-util-print!) | |
(.on js/process "uncaughtException" #(js/console.error %)) |
;; Prints a table of vars in an ns with name/line/added/macro flag/deprecated flag | |
(defn pr-vars [ns-sym] | |
(->> (ns-publics ns-sym) vals (map meta) (sort-by :name) | |
(map #(select-keys % [:name :line :added :macro :deprecated])) | |
(map #(merge {:added nil :macro false :deprecated false} %)) | |
clojure.pprint/print-table)) | |
(pr-vars 'clojure.string) | |
;; | :added | :macro | :deprecated | :name | :line | |
I made a documentation generator that cashes in on Clojure's dynamism. See the play-cljs docs (a ClojureScript game library) for an example of its output.
Like many of you, I've often wondered what my final regret will be on my deathbed. My best guess came to me in a dream recently. I was walking across the charred earth of an apocalyptic future world, maneuvering around the remains of the less fortunate. I was startled to find a young girl, barely holding onto her life. She murmured something to me. I asked her to repeat it, and she said more loudly: "I...wish your Clojure projects didn't have such crappy documentation."