home/ atoms/ punctual-dollar-vs-ampersand-application

Punctual's $ makes everything to its right the final argument while & is reverse application; confusing them silently reorders the graph

Punctual has two application operators that control argument order. $ takes everything to its right and passes it as the final argument of the function on its left: lpf 1000 1 $ saw 110 filters the saw. & is reverse application, feeding the value on its left into the function on its right: saw 110 & lpf 1000 1 does the same thing read left-to-right. Mixing them up does not raise an error — it silently produces a different graph wiring, so a filter may end up filtering the wrong signal or a source lands in the wrong argument slot.

Examples

lpf 1000 1 $ saw 110 — saw is the source filtered. saw 110 & lpf 1000 1 — equivalent, reversed reading. Swapping $/& reorders which value becomes the source.

Assessment

Rewrite lpf 800 2 $ osc 220 using the & operator so it produces the identical graph, and explain what each operator does to argument order.

“**`$` vs `&`:** `$` makes everything to its right the final argument (`lpf 1000 1 $ saw 110`); `&` is reverse application (`saw 110 & lpf 1000 1`). Mixing them up silently reorders the graph.”
context/ · L1-instruments/punctual/gotchas.md · chunk 1