So I was thinking about the definitions of MINIMIMUM / MAXIMUM and MIN / MAX, and realized that this was yet another case where you quite probably want variables called MIN and MAX.
For this reason, Ren-C had at one point renamed these to MINIMUM-OF/MIN-OF and MAXIMUM-OF/MAX-OF.
But this is another case where it would look better without the wart:
max: max-of a b
max: max of a b
I've come to really see being able to read code which reuses a word like max in such a way and not freak out as being part of the Relative-Expression bit of [R]elative [E]xpression-[B]ased [O]bject [L]anguage
You're relative to the OF, on its left side...
We break the rules others won't, and get something in the bargain!
Looking at this old question, I realized something...
The Earth Has Moved Since 2017
Virtual Binding
Functions like OF can actually receive a binding environment.
And... while this might sound a little bit loopy... OF can simply tack -OF onto the symbol you pass it, and look that up in the environment it runs in.
So basically, you extend the reflectors the same way you'd write any other function. Just end the function name in -of
.
whatever-of: func [a b] [
print ["WHATEVER!" mold a mold b]
]
>> whatever of [1 2 3] $10
WHATEVER! [1 2 3] $10
Then it becomes a personal choice. You can use whatever-of or whatever of as you so choose. And if you want help, you can ask it on whatever-of and know what its applicable types are...
Is it a little bit kludgey? Sure, but what good is virtual binding if we don't use it!
I'm going to give it a shot. There's probably some easy optimizations for linking symbols like WHATEVER to be able to navigate to the symbol for WHATEVER-OF rapidly so you don't have to do any hashing to find it... at least for builtin symbols (e.g. put them sequentially in the SymId table).
UPDATE: It works! And the the sequential symbol optimization works too!