specter

weavejester 2025-06-08T11:14:19.942889Z

I have cond-path with a fallback value. Currently I'm writing:

(s/cond-path
  pred-1? [...]
  pred-2? [...]
  (constantly true) [...])
Is there a more elegant way to write this?

nathanmarz 2025-06-08T17:29:14.864059Z

@weavejester I would use STAY for the final handler

nathanmarz 2025-06-08T17:29:35.996049Z

conditionals in Specter paths aren't predicates exactly, but based on whether that path navigates anywhere

nathanmarz 2025-06-08T17:29:52.831539Z

so STAY is "true" in that context, and STOP is "false"

❗ 1
weavejester 2025-06-08T17:40:59.304299Z

Ahhhhh, I see! That makes a lot of sense.

weavejester 2025-06-08T17:42:18.095359Z

I still don't have a good intuition about writing specter, but I think I'm slowly getting there.

🚀 1