Here's a commonly repeating pattern: you need two pick one of two values based on a condition.
For, example, say you need to pick one of two strings. Sure, you can write:
str: either cond ["this"]["that"]
Of course, that line seems inefficient because you're evaluating one of two blocks. You're forcing the interpreter to nest (and nesting is for the birds unless you're really computing something.)
Instead, I often write the more optimal expression:
str: pick ["this" "that"] cond
The pick action is fast, but cond better be TRUE or FALSE (or 1 or 2) or boom - throw exception.
Yet even further, if the values are actually variables the above becomes a bit longer...
str: get pick [this that] cond
Being a greedy block-miser, I must say I'm dissatisfied by any of these methods. (Insatisfait, as I am learning to say.) So, these days I've started writing:
str: pick1 cond this that
Of course, since pick1 is a user-defined function, it's not really more efficient in evaluation, it just looks better.
All of this is really just nit picking... but it's funny how little nits eat away at you during long coding sessions. But, dreaming... if pick1 were a native... now maybe we have something there. (Would take maybe 10 minutes to add it.)
Of course, then we'd need a good name for it, and you know what that means...
What do you think? Is this food for thought or nits for picking?