Skip to content

Instantly share code, notes, and snippets.

Fogus fogus

Block or report user

Report or block fogus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
fogus /
Created Jul 8, 2019 — forked from frenchy64/
Notes on JavaScript prototypes

Why Objects were successful

  • essense of objects is (dynamic) dispatch
  • dispatch provides interoperability
  • first-class interoperability is critical to frameworks and ecosystems
  • frameworks and ecosystems are economically critical to the software industry
  • likely a significant factor in objects' success
  • Also talks about early mistakes in Simula

Why objects are inevitable

View time.txt
"Programs with Common Sense" by JMC
"Situations, Actions, and Causal Laws" by JMC
"A Framework for Representing Knowledge" by Minsky
"Why Object-Oriented Languages Need Tail Calls" by GLS
"Worlds: Controlling the Scope of Side-Effects" by Warth, Ohshima, Kaehler, Kay
View maze-generation
(require '[clojure.string :as s])
(defn north-of [[row col]] [(dec row) col])
(defn south-of [[row col]] [(inc row) col])
(defn west-of [[row col]] [row (dec col)])
(defn east-of [[row col]] [row (inc col)])
(defn neighbours [rows cols cell]
View mccarthy-eval.lisp
; John McCarthy, Artificial Intelligence Laboratory, Stanford University
; for CL : Rainer Joswig,
; this version runs in a Common Lisp
fogus / magic-the-gathering-card-spec.clj
Created Jul 13, 2018 — forked from robert-stuttaford/magic-the-gathering-card-spec.clj
Noodling around with core.spec, modelling M:tG card data
View magic-the-gathering-card-spec.clj
(ns magic-the-gathering-card-spec
(:require [clojure.spec :as s]
[clojure.spec.gen :as gen]))
(s/def ::pos-int (s/and int? (complement neg?)))
(s/def ::set string?)
(s/def ::set-number ::pos-int)
(s/def ::artist string?)
View MOP-COLA.adoc
fun send(rcv, msg, args) {
  cls = rcv.isa
  if (cls.isa == STD_CLS)
    method = builtin_lookup(rcv, msg)
    method = send(cls, "lookup", msg)
  method(rcv, args)
View units.clj
(ns party.units
(:refer-clojure :exclude [+ - * /])
(:require [clojure.algo.generic.arithmetic :as ari :use [+ - * /]]))
(defrecord Measurement [factor units]
(invoke [a b] (* a b)))
(defn ^:private short-name [sym]
(if (= (namespace sym) (namespace `foo))
View thinks.txt
# books that helped form MY thinking about technology/programming/systems
## more so
Architecture of Symbolic Computers by Kogge
Art of the Metaobject Protocol by Kiczales, et al.
Bootstrapping by Thierry Bardini
Commodore 64 users guide
Computer Lib / Dream Machines by Ted Nelson
fogus / service.clj
Last active Dec 1, 2017 — forked from mtnygard/service.clj
Using the not-found-interceptor as a catchall
View service.clj
(ns support.service
(:require [io.pedestal.http :as http]
[io.pedestal.http.route :as route]))
(defn about-page
{:status 200 :body (format "Clojure %s - served from %s"
(route/url-for ::about-page))})
fogus / canon.txt
Last active Jun 24, 2018
my personal canon
View canon.txt
1984 by Orwell
*Act of Creation by Koestler
AEgypt by John Crowley
After Dark by Haruki Murakami
Architecture of Symbolic Computers by Kogge
Art of the Metaobject Protocol by Kiczales, et al.
Baron in the Trees by Calvino
Babel-17 by Delany
Bill James' Baseball Abstract, 1985 by Bill James
Bootstrapping by Thierry Bardini
You can’t perform that action at this time.