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.
A hopefully short and concise explanation as to how Clojure deals with Objects. If you already write Clojure, this isn't for you.
You know what an Interface is if you write/read Java or PHP 5+. In Clojure it might be called defprotocol.
user> (defprotocol IABC
(also-oo [this])
(another-fn [this x]))
IABC
Increase the number of "Recent Places" that OSX shows in save dialogs. This allows you to quickly save files without having to dig through nested folders.
- Open your terminal and run
defaults write .GlobalPreferences NSNavRecentPlacesLimit -int 10 && killall Finder
- OSX will now save 10, instead of the default. You won't see it take effect right away, but only after you save 5 more things.
- Enjoy your better life.
Forked from Captain Anonymous's Pen QyMWax.
A Pen by Ben Damman on CodePen.
struct Keycode { | |
// Layout-independent Keys | |
// eg.These key codes are always the same key on all layouts. | |
static let returnKey : UInt16 = 0x24 | |
static let enter : UInt16 = 0x4C | |
static let tab : UInt16 = 0x30 | |
static let space : UInt16 = 0x31 | |
static let delete : UInt16 = 0x33 | |
static let escape : UInt16 = 0x35 |
defmodule Store do | |
@initializer_action %{type: "@@INIT"} | |
# Code your Mom calls | |
def start_link(reducer, initial_state \\ nil) do | |
GenServer.start_link(__MODULE__, [reducer, initial_state]) | |
end | |
def get_state(store) do |
(ns bubble.core | |
(:require [d3 :as d3])) | |
(enable-console-print!) | |
(.format d3 "d") ; we will use integers for our data | |
; set up a color sequence. Later on we will pass numbers to the | |
; 'color' function defined here and it will give us back colours one | |
; by one. |
Note This is a little out of date. Rust has made some progress on some points, however many points still apply.
Swift shares Rust's enthusiasm for zero-cost abstractions, but also emphasizes progressive disclosure. Progressive disclosure requires that language features should be added in a way that doesn't complicate the rest of the language. This means that Swift aims to be simple for simple tasks, and only as complex as needed for complex tasks.
function doStripe() { | |
if (!document.getElementById('card-element')) { | |
return; | |
} | |
var stripe = Stripe(window.stripe_key); | |
var elements = stripe.elements(); | |
var style = {}; | |
var card = elements.create('card', {style: style}); |