|
74 | 74 | (dynamic? [this])) |
75 | 75 |
|
76 | 76 | (defprotocol CtxVar |
77 | | - (needs-ctx? [this]) |
78 | | - (needs-ctx! [this])) |
| 77 | + (needs-ctx? [this])) |
79 | 78 |
|
80 | 79 | (extend-type #?(:clj Object :cljs default) |
81 | 80 | DynVar |
|
206 | 205 | (defn built-in-var? [var-meta] |
207 | 206 | (:sci/built-in var-meta)) |
208 | 207 |
|
| 208 | +(deftype CtxFn [f] |
| 209 | + ;; #?(:cljs Fn) ;; In the real CLJS this is there... why? |
| 210 | + #?(:clj clojure.lang.IFn :cljs IFn) |
| 211 | + (#?(:clj invoke :cljs -invoke) [_this] |
| 212 | + (f)) |
| 213 | + (#?(:clj invoke :cljs -invoke) [_this a] |
| 214 | + (f a)) |
| 215 | + (#?(:clj invoke :cljs -invoke) [_this a b] |
| 216 | + (f a b)) |
| 217 | + (#?(:clj invoke :cljs -invoke) [_this a b c] |
| 218 | + (f a b c)) |
| 219 | + (#?(:clj invoke :cljs -invoke) [_this a b c d] |
| 220 | + (f a b c d)) |
| 221 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e] |
| 222 | + (f a b c d e)) |
| 223 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e f] |
| 224 | + (f a b c d e f)) |
| 225 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e f g] |
| 226 | + (f a b c d e f g)) |
| 227 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e f g h] |
| 228 | + (f a b c d e f g h)) |
| 229 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e f g h i] |
| 230 | + (f a b c d e f g h i)) |
| 231 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e f g h i j] |
| 232 | + (f a b c d e f g h i j)) |
| 233 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e f g h i j k] |
| 234 | + (f a b c d e f g h i j k)) |
| 235 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e f g h i j k l] |
| 236 | + (f a b c d e f g h i j k l)) |
| 237 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e f g h i j k l m] |
| 238 | + (f a b c d e f g h i j k l m)) |
| 239 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e f g h i j k l m n] |
| 240 | + (f a b c d e f g h i j k l m n)) |
| 241 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e f g h i j k l m n o] |
| 242 | + (f a b c d e f g h i j k l m n o)) |
| 243 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e f g h i j k l m n o p] |
| 244 | + (f a b c d e f g h i j k l m n o p)) |
| 245 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e f g h i j k l m n o p q] |
| 246 | + (f a b c d e f g h i j k l m n o p q)) |
| 247 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e f g h i j k l m n o p q r] |
| 248 | + (f a b c d e f g h i j k l m n o p q r)) |
| 249 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e f g h i j k l m n o p q r s] |
| 250 | + (f a b c d e f g h i j k l m n o p q r s)) |
| 251 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e f g h i j k l m n o p q r s t] |
| 252 | + (f a b c d e f g h i j k l m n o p q r s t)) |
| 253 | + (#?(:clj invoke :cljs -invoke) [_this a b c d e f g h i j k l m n o p q r s t rest] |
| 254 | + (apply f a b c d e f g h i j k l m n o p q r s t rest)) |
| 255 | + #?(:clj |
| 256 | + (applyTo [_this args] |
| 257 | + (apply f args)))) |
| 258 | + |
209 | 259 | (macros/deftime |
210 | 260 | (defmacro with-writeable-var |
211 | 261 | [the-var var-meta & body] |
|
0 commit comments