This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let [person {:first-name "Fred" ;;Binding this map literal, with stuff nested in it, to the symbol 'person'. | |
:age 42 | |
:pets {:dogs ["Rusty" "Fido"] | |
:cats ["Snowy" "Tom" "Garfield" "Queenie"]} | |
:family [{:name "Sarah" | |
:relation :wife} | |
{:name "Dennis" | |
:relation :son}]} | |
;;Here comes a bunch of destructuring! | |
{:keys [first-name age] ;;Just picking key values directly from the root level of the map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defproject derpanet "0.1.0-SNAPSHOT" | |
:description "FIXME: write this!" | |
:url "http://example.com/FIXME" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:dependencies [[org.clojure/clojure "1.6.0"] | |
[org.clojure/clojurescript "0.0-3211"] | |
[org.clojure/core.async "0.1.346.0-17112a-alpha"] | |
[reagent "0.5.0"]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ^:figwheel-always derpanet.core | |
(:require [reagent.core :as r] | |
[figwheel.client :as fw :include-macros true] | |
[cljs.core.async :refer [chan close!]]) | |
(:require-macros | |
[cljs.core.async.macros :as m :refer [go]])) | |
(defn number-box [number text-color] | |
[:p {:style {:border-color "black" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns derpa.core | |
(:gen-class)) | |
(defn initialize-cells [number] (vec (repeat number 0))) | |
(defn interpret [src] | |
(loop [src src | |
reader-position 0 | |
cells (initialize-cells 200) | |
cell-pointer 50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns derpa.core | |
(:gen-class)) | |
(defn initialize-cells [number] (vec (repeat number 0))) | |
(defn interpret [src] | |
(loop [src src | |
reader-position 0 | |
cells (initialize-cells 200) | |
cell-pointer 50 |