Make every caller say what it means: no defaulted arities
Pre-alpha. Nothing here is owed a call shape it used to have.
Twelve convenience arities deleted, and the only reason to single any of
them out is that one of them was a live bug: `channel/value-at`'s `([ch f])`
filled in a nil tier-2 store, so a caller could omit it, read correctly for
every channel that happened not to be dense, and throw the first time one
was. That is the iris crash, and threading the store through `gesture/values`
last commit fixed the symptom while leaving the trapdoor open. Deleting the
arity found `node/toggle-key` standing on it too — the inspector's stopwatch
on a measured channel, the same throw, never reported.
Gone, and what the compiler then made explicit at each site:
channel/value-at, cursor, dense-at the store, and `nil` where a caller
genuinely has none and means it
channel/keyed `:hold`, which is a cut rather than a
tween and not a thing to leave implied
symbol/resolver (4), eval-frame (3) store, palette, pose-tracks, opts
clip/resolver opts
mix/buffer!, store/install! dead: no caller used the short form
`pick/local-bounds` goes the same way — it was `bounds-of` with the closure
thrown away, so callers build the closure and call it.
Every site was found by shadow-cljs `:fn-arity` rather than by grep, which is
the argument for the change: 90-odd call sites, and the compiler listed all of
them. BUILD BOTH TARGETS — the last three only appear in `:app`, since `:test`
compiles what the tests reach and the inspector, the pool drag and the vertex
overlay are not that.
Left alone, because an argument with a default is not the same thing as a
shim: genuine optionality like `fx/http`'s body, `geom`'s iteration count,
`zip`'s injected clock.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
11093079de
commit
ee66680a0c
30 changed files with 224 additions and 217 deletions
|
|
@ -17,7 +17,7 @@
|
|||
:nodes {:root {:id :root :kind :group :z "a1"}
|
||||
:mark {:id :mark :kind :rect :parent :root :z "a1"
|
||||
:channels {[:xform :pos] (ch/keyed {0 [0 0] 1 [10 0]
|
||||
2 [20 0] 3 [30 0]})
|
||||
2 [20 0] 3 [30 0]} :hold)
|
||||
[:geom :size] (ch/framed 4)
|
||||
[:style :color] (ch/framed :brow)}}}}}})
|
||||
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
:channels {[:xform :pos] (ch/framed [120 50])}}}})
|
||||
(assoc-in [:symbols :sym/test]
|
||||
(assoc (get-in source [:symbols :main]) :id :sym/test)))
|
||||
resolve (clip/resolver document nil pal/index-of :main)
|
||||
resolve (clip/resolver document nil pal/index-of :main nil)
|
||||
at (fn [f] (mapv (juxt :node :cx) (resolve f)))]
|
||||
(is (empty? (clip/problems document)))
|
||||
(is (= [[[:left :mark] 110]] (at 1)))
|
||||
|
|
@ -46,13 +46,13 @@
|
|||
|
||||
(deftest a-placement-holds-and-cuts-each-generated-shape-independently
|
||||
(let [values (js/Int16Array. (clj->js (range 2 32)))
|
||||
visible (ch/keyed {0 true 20 true 21 false})
|
||||
visible (ch/keyed {0 true 20 true 21 false} :hold)
|
||||
dense {:animated? true :interp :hold
|
||||
:dense {:store "sizes" :offset 0 :stride 1 :frames 30}
|
||||
:pose-sampled? true}
|
||||
shape (fn [id z group]
|
||||
{:id id :kind :rect :parent :root :z z :pose-group group
|
||||
:channels {[:xform :pos] (ch/keyed {0 [0 0] 8 [8 0]})
|
||||
:channels {[:xform :pos] (ch/keyed {0 [0 0] 8 [8 0]} :hold)
|
||||
[:geom :size] dense
|
||||
[:vis] (assoc visible :pose-sampled? true)
|
||||
[:style :color] (ch/framed :brow)}})
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
:parent :root :z "a2"
|
||||
:playback {:tracks {:mouth {0 0, 8 8}}}}}}
|
||||
:sym/poses symbol}}
|
||||
resolve (clip/resolver document {"sizes" {:data values}} pal/index-of :main)
|
||||
resolve (clip/resolver document {"sizes" {:data values}} pal/index-of :main nil)
|
||||
low-resolve (clip/resolver document {"sizes" {:data values}}
|
||||
pal/index-of :main {:picture-fps 8})
|
||||
at (fn [f] (into {} (map (fn [op] [(:node op) op])) (resolve f)))
|
||||
|
|
@ -178,15 +178,15 @@
|
|||
scale (get-in left [:channels [:xform :scale]])
|
||||
anchor (get-in left [:channels [:xform :anchor] :value])
|
||||
pos (get-in left [:channels [:xform :pos]])
|
||||
start-pos (ch/value-at pos 0)]
|
||||
start-pos (ch/value-at pos 0 nil)]
|
||||
(is (= [160 100] anchor) "the source center becomes a stored pivot")
|
||||
(is (= [-120 -60] start-pos))
|
||||
(is (not= start-pos (ch/value-at pos 40)) "the face drifts during playback")
|
||||
(is (= [0.4 0.4] (ch/value-at scale 0)))
|
||||
(is (= [0.56 0.56] (ch/value-at scale 12)))
|
||||
(is (= [0.52 0.52] (ch/value-at scale 48)))
|
||||
(is (not= start-pos (ch/value-at pos 40 nil)) "the face drifts during playback")
|
||||
(is (= [0.4 0.4] (ch/value-at scale 0 nil)))
|
||||
(is (= [0.56 0.56] (ch/value-at scale 12 nil)))
|
||||
(is (= [0.52 0.52] (ch/value-at scale 48 nil)))
|
||||
(doseq [f [0 12 48]]
|
||||
(let [m (node/local! (node/mat) start-pos 0 (ch/value-at scale f) [0 0] anchor)
|
||||
(let [m (node/local! (node/mat) start-pos 0 (ch/value-at scale f nil) [0 0] anchor)
|
||||
out (js/Float64Array. 2)]
|
||||
(node/apply-pt! out 0 m 160 100)
|
||||
(is (= [40 40] [(aget out 0) (aget out 1)])
|
||||
|
|
@ -200,10 +200,10 @@
|
|||
(is (= [48 260] (node/placed-span (placement document :voice-right))))
|
||||
(is (= 0.5 (ch/value-at
|
||||
(get-in (placement document :voice-right)
|
||||
[:channels [:audio :gain]]) 54)))
|
||||
[:channels [:audio :gain]]) 54 nil)))
|
||||
(is (< -0.8 (ch/value-at
|
||||
(get-in (placement document :voice-right)
|
||||
[:channels [:audio :pan]]) 110) 0.7))
|
||||
[:channels [:audio :pan]]) 110 nil) 0.7))
|
||||
(is (= document (leaf/clip "stage" (leaf/leaves "stage" document))))))
|
||||
|
||||
(defn- nested
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue