specter

Samuel Ludwig 2025-04-09T16:01:06.366139Z

silly baby question, I'm trying to grok (filterer ) vs , and the relationship of other navigators; when to use one over the other, etc. can someone explain the difference of whats going on between

(select [(filterer odd?)] [2 1 3 6 7 4 8]) ;=> [[1 3 7]]

;; AND ;;

(select [ALL odd?] [2 1 3 6 7 4 8]) ;=> [1 3 7]
What I'm really curious about is why I can navigate to LAST for the first one and get [7], while the second one throws an error? (Additionally, I'm also not sure why I can't call odd? for the second one outright, without the ALL like the first)

Samuel Ludwig 2025-04-09T16:37:42.820969Z

(ok actually, I get why the ALL is required on the second, but still not sure why it isn't required on the first one)

nathanmarz 2025-04-09T16:40:15.880179Z

filterer navigates to a sequence, whereas ALL navigates to the individual elements

nathanmarz 2025-04-09T16:40:33.014449Z

the result of select is a sequence of all values navigated to by the path

nathanmarz 2025-04-09T16:40:47.361659Z

when you do LAST, you're navigating on whatever's currently navigated to

nathanmarz 2025-04-09T16:40:53.805249Z

not on the result sequence

nathanmarz 2025-04-09T16:41:18.148729Z

after [ALL odd?] navigators, it's navigated to the individual numbers 1, 3, and 7

Samuel Ludwig 2025-04-09T16:43:10.477089Z

ahhhhhhh ok so a definite source of my misunderstanding is a conflation of selects output and "what specter actually sees"

Samuel Ludwig 2025-04-09T16:50:53.821759Z

i appreciate the help, i cant treat the 'navigated-to elements' as a sequence

nathanmarz 2025-04-09T16:51:54.723919Z

you can use subselect to get navigated values into a sequence within a path

nathanmarz 2025-04-09T16:52:03.627329Z

which is actually how filterer works

nathanmarz 2025-04-09T16:52:18.026569Z

(filterer odd?) is just (subselect ALL odd?)

Samuel Ludwig 2025-04-09T16:53:59.590609Z

!!! beautiful