To be or not to be: that is the question


#1

If you’re trying to find if a named value exists in a collection, you can use find? now for all of these

  • If there is a named member in a block!
  • If there is a named member in an object!
  • If there is a named member in a map!

find? something 'element


#2

The “?” chain variants were introduced largely to stop things like found?: :true? | if found? find .... I should point out that while some people (e.g. @gchiu) seem to like using the ? variants of functions for clarity, the “blankifying” nature means you get the same behavior when it’s in a conditional, if the body is an arity-1 function:

if find [...] ... [
    ...
]

vs.

if find? [...] ... [
    ...
]

I think it’s cleaner and just as clear. So really, it only makes sense to me to use the ?-versions when you’re assigning to a variable you wish to be LOGIC!. (logic-variable: find? ...) (But that stirs up another question I will write about, regarding the future of LOGIC!)

Note another interesting aspect of FIND vs. FIND? is that due to a recent change, the former can actually pass through the value you found when used in a conditional:

if find [...] ... (func [pos] [
    dump pos
])

Whereas you used FIND? you’d just always be getting a true there.