This file contains hidden or 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
(defmacro defstg [name & body] | |
`(do (declare ~name) | |
(let [bldg# (do ~@body)] | |
(when-not | |
(instance? clojure.lang.Var+Unbound | |
(var-get (resolve (quote ~name)))) | |
(destroy ~name)) | |
(def ~name bldg#)))) |
This file contains hidden or 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
(import '[UnityEngine Quaternion Vector3]) | |
(set! *warn-on-reflection* true) | |
;; note this takes an optional default value. This macro is potentially | |
;; annoying in the case that you want to branch on a supertype, for | |
;; instance, but the cast would remove interface information. Use with | |
;; this in mind. | |
(defmacro condcast-> [expr xsym & clauses] | |
(let [exprsym (gensym "exprsym_") |
This file contains hidden or 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 quaternion-exploration | |
(:import [UnityEngine Quaternion Vector3]) | |
(:use arcadia.core | |
arcadia.hydrate | |
clojure.repl | |
clojure.pprint)) | |
;; like emacs. kind of. | |
(defn kill! [x] | |
(let [spec (dehydrate x)] |
This file contains hidden or 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
;; funny little macro to make interop bit less painful | |
(set! *warn-on-reflection* true) | |
(defmacro set-with! [obj [sym prop] & body] | |
`(let [obj# ~obj | |
~sym (. obj# ~prop)] | |
(set! (. obj# ~prop) (do ~@body)))) | |
;; use: ---------------------------------------- |
This file contains hidden or 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
(def ^:dynamic *x* :default-x) | |
(def ^:dynamic *y* :default-y) | |
(def ^:dynamic *z* :default-z) | |
(def ^:dynamic *opts* {:x *y* :y *z* :z *x*}) | |
(defn awesome-fn [f x y z & {:as opts | |
:keys [x y z] | |
:or {x *x* | |
y *y* |
This file contains hidden or 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
(require '[clojure.string :as s]) | |
(set! *print-length* nil) | |
(def starspeck-raw | |
(vec | |
(s/split-lines | |
(slurp "/Volumes/DUv3_9pview/Digital Universe/data/milkyway/specks/stars.speck")))) | |
(let [fields | |
[:x :y :z :colorb-v :lum :absmag :appmag :texnum :distly :dcalc :plx :plxerr :vx :vy :vz :speed :hipnum]] |
This file contains hidden or 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
;; at the moment, array population works by swapping out existing | |
;; array for new one (possibly of greater length). Should work for | |
;; components, which copy their arrays anyway, might be problematic in | |
;; other cases though. wonder if this will even work in the case of eg | |
;; meshes, or if some other setting pattern is needed. This whole | |
;; thing is kind of sketchy, treatment of arrays breaks idea of spec | |
;; type agnosticism. | |
(defn- set-clause-array-populate [setable ctx] | |
(let [et (element-type ...)] | |
`(let [~instsym (. ~targsym ~name) |
This file contains hidden or 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
using clojure.core.protocols; | |
using clojure.lang; | |
using compile__stub.clojure.core; | |
using Microsoft.Scripting.Utils; | |
using System; | |
using System.Collections; | |
using System.Runtime.CompilerServices; | |
namespace clojure.core | |
{ |
This file contains hidden or 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
(defn problematic-case-fn [x] | |
(case x | |
:xnw "xnw" :ltg "ltg" :qmu "qmu" :tff "tff" :btw "btw" :zpo "zpo" :dsq "dsq" :tvk "tvk" :iey "iey" :vut "vut" :qyg "qyg" :xgj "xgj" :bpa "bpa" :pgk "pgk" :ovf "ovf" :wqi "wqi" :vwd "vwd" :nfn "nfn" :une "une" :iru "iru" :eyu "eyu" :lfa "lfa" :mmh "mmh" :fze "fze" :siv "siv" :ggq "ggq" :yrf "yrf" :zcz "zcz" :uhl "uhl" :xiu "xiu" :mpi "mpi" :rxa "rxa" :wlg "wlg" :jgi "jgi" :cur "cur" :gbv "gbv" :ddm "ddm" :dki "dki" :lai "lai" :kek "kek" :gia "gia" :dxz "dxz" :tlg "tlg" :odc "odc" :xvx "xvx" :cdg "cdg" :zes "zes" :hci "hci" :voh "voh" :cmu "cmu" :ucc "ucc" :psw "psw" :eia "eia" :tao "tao" :elp "elp" :hzj "hzj" :mux "mux" :twh "twh" :uuy "uuy" :qkj "qkj" :tbu "tbu" :ply "ply" :xws "xws" :ztw "ztw" :gky "gky" :egz "egz" :cwu "cwu" :bby "bby" :usv "usv" :cun "cun" :nlo "nlo" :gvu "gvu" :rdk "rdk" :bla "bla" :ddu "ddu" :yrz "yrz" :xej "xej" :imk "imk" :kfm "kfm" :xvw "xvw" :cre "cre" :eqo "eqo" :rnd "rnd" :otf "otf" :ubf "ubf" :aqn "aqn" :xmx "xmx" :cxf "cxf" :dvx "dvx" : |
This file contains hidden or 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
public override object invoke (object obj) | |
{ | |
string arg_4889_0; | |
switch (Util.hash (obj) >> 0 & 4095) | |
{ | |
case 67: | |
if (obj == case_problem$unproblematic_case_fn__69.const__0) | |
{ | |
arg_4889_0 = "lai"; | |
return arg_4889_0; |
OlderNewer