Skip to content

Instantly share code, notes, and snippets.

Ambrose Bonnaire-Sergeant frenchy64

  • Bloomington, Indiana
Block or report user

Report or block frenchy64

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
@frenchy64
frenchy64 / diagnose.clj
Last active Aug 29, 2015
Handy tools.trace
View diagnose.clj
; [org.clojure/tools.trace "0.7.5"]
(require '[clojure.tools.trace :as trace]
'[clojure.repl :as repl])
(defmacro spit-to
"Dump diagnostics to a file"
[f & body]
`(spit ~f
View gist:8848928
Without dynalint:
(first 1)
IllegalArgumentException Don't know how to create ISeq from: java.lang.Long clojure.lang.RT.seqFrom (RT.java:505)
With dynalint:
(first 1)
ExceptionInfo ERROR (Dynalint id 4): First argument to clojure.core/first must be seqable: 1 (instance of class java.lang.Long) clojure.core/ex-info (core.clj:4327)
View taj.clj
(ns ^:skip-wiki clojure.core.typed.analyze-clj
(:require [clojure.jvm.tools.analyzer :as analyze]
[clojure.jvm.tools.analyzer.hygienic :as hygienic]
[clojure.tools.analyzer :as ta]
[clojure.tools.analyzer.jvm :as taj]
[clojure.tools.reader :as tr]
[clojure.tools.reader.reader-types :as readers]
[clojure.string :as str]
[clojure.java.io :as io]
[clojure.core.typed.utils :as u]))
View trampoline.clj
(ns clojure.core.typed.test.trampoline
(:require [clojure.core.typed :as t]))
(declare funb)
(t/ann-many [Number -> (Rec [f]
(U Number [-> (U Number f)]))]
funa funb)
(defn funa [n]
(if (= n 0)
@frenchy64
frenchy64 / min.clj
Last active Aug 29, 2015
ctyp-108 min
View min.clj
; CTYP-108
(tc-e
(let [{:keys [a] :as props}
(ann-form {} '{})]
(when-not (and a)
(print-env "")
props)))
{:env {a__#0 (U nil false), props__#0 (HMap :mandatory {}), map__63343__#1 (HMap :mandatory {}), map__63343__#0 (HMap :mandatory {})},
:props ((when (is (U nil false) props__#0)
View ana.clj
; [org.clojure/tools.analyzer.jvm "0.1.0-beta4"]
(ns tst.ana
(:require
[clojure.tools.analyzer.jvm :as taj]
[clojure.tools.analyzer.passes.jvm.emit-form :as emit-for m]))
(defn ^:private analyze1 [form env]
(let [a (taj/analyze form env)
frm (emit-form/emit-form a)]
(eval frm)
View clj.clj
(ns analyze.clj
(:require [clojure.tools.analyzer :as ta]
[clojure.tools.analyzer.jvm :as taj]
[clojure.tools.analyzer.passes.jvm.emit-form :as emit-form]
[clojure.tools.reader :as tr]
[clojure.tools.reader.reader-types :as readers]
[clojure.string :as str]
[clojure.java.io :as io]))
(defn ^:private analyze1 [form env]
View hw.c
#include <stdio.h>
int main()
{
char string[] = "Hello World";
printf("%s\n", string);
return 0;
}
View gist:9271711
(deftype FooDT [normal other-keys?])
(.normal ^FooDT (->FooDT 2 1))
View overtone.clj
(t/ann overtone.music.pitch/chord
(Fn [Note Scale -> (t/Set MIDINote)]
[Note Scale Inversion -> (t/Set MIDINote)]))
You can’t perform that action at this time.