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
View MOP-COLA.adoc
fun send(rcv, msg, args) {
  cls = rcv.isa
  if (cls.isa == STD_CLS)
    method = builtin_lookup(rcv, msg)
  else
    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]
clojure.lang.IFn
(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
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
[request]
{:status 200 :body (format "Clojure %s - served from %s"
(clojure-version)
(route/url-for ::about-page))})
@fogus
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
View apple-langs.md

Apple Languages

Criteria

For inclusion on this list, the language must adhere to at least one of the following:

  1. Developed by Apple and released either free or as product. (e.g. Swift)
  2. Developed by Apple but never formally released during its lifetime. (e.g. SK8)
  3. Licensed by Apple for use in and/or as an official Apple product. (e.g. Applesoft BASIC)
  4. Used by internal teams to develop new or exiting products (e.g. SWEET-16)
View rich-already-answered-that.md

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats. The link points back at them.

Why no pattern matching?

If you are talking about the aspect of pattern matching that acts as a conditional based upon structure, I'm not a big fan. I feel about them the way I do about switch statements - they're brittle and

View lisp.pas
{+ PASCAL/Z COMPILER OPTIONS +}
{++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
{$C- <<< CONTROL-C KEYPRESS CHECKING OFF >>> }
{$F- <<< FLOATING POINT ERROR CHECKING OFF >>> }
{$M- <<< INTEGER MULT & DIVD ERROR CHECKING OFF >>> }
{++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
PROGRAM LISP {VERSION 1.7};
{
+ PROGRAM TITLE: THE ESSENCE OF A LISP INTERPRETER.
+ WRITTEN BY: W. TAYLOR AND L. COX
View email.clj
(defn valid-email? [email]
(let [pattern #"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"]
(and (string? email) (re-matches pattern email))))
View j.c
typedef char C;
typedef long I;
typedef struct a {
I t, r, d[3], p[2];
} *A;
#define P printf
#define R return
#define V1(f) A f(w)A w;
You can’t perform that action at this time.