Hi @nathanmarz
Long story short: We found ourselves in a situation with a path that contains a terminal inside a if-path cond (please don't ask how 😅).
We figured that terminal return NONE on select* causes the terminal to act as a false in the if-path cond.
We created our own terminal which returns nil on select*.
Can you see any ramifications for that?
Or, can you tell us what the NONE in terminal was meant to accomplish?
if you want that logic, then you can change your select* to call (next-fn structure)
What is the next-fn of the last navigator?
that's determined by whether it's select, select-one, or select-any
[], nil, NONE?
select accumulates navigated values into a volatile
select-any / select-one rely on the return value of select*
select-one just checks that it hasn't navigated to more than one place
not sure what you're asking
can you show the full path in question?
(sp/multi-transform (sp/if-path [:x (terminal-hack inc)]
[:x (terminal-hack inc)])
{:x 0}) ; => {:x 1}
(sp/multi-transform (sp/if-path [:x (sp/terminal inc)]
[:x (sp/terminal inc)])
{:x 0}) ; => {:x 0}
where
(sp/defrichnav
^{:doc "Defines an endpoint in the navigation the transform function run. The transform
function works just like it does in `transform`, with collected values
given as the first arguments"}
terminal-hack
[afn]
(select* [this vals structure next-fn]
nil) ; changed this value from NONE to nil
(transform* [this vals structure next-fn]
(i/terminal* afn vals structure)))the protocol of select* is to return NONE if it navigates nowhere
or if everywhere it navigates navigates nowhere
so that navigator definition breaks the protocol
you just shouldn't have terminal inside if-path conditions
it is currently a part of our navigation system and we need to answer the question "does this path lead somewhere?" much like if-path works
it's just that we compose terminals to it (partially to support promise chaining)
alternatively, can we ask "does this path lead somewhere or is it a terminal?" instead?