Issue 4705

Simen Kjaeraas simen.kjaras at gmail.com
Sun Sep 18 12:38:14 PDT 2011


On Sat, 17 Sep 2011 16:06:44 +0200, Timon Gehr <timon.gehr at gmx.ch> wrote:

>>> xyz!"a<b"([1,2,3,1,2,3]) is 1
>>>
>>> xyz!"a>b"([1,2,3,1,2,3]) is 3
>>>
>>> Question is what's a good name for xyz. It returns the element X of the
>>> range such that pred(E, X) is false for all E in the range. Then we'd
>>> defined xyzCount and xyzPos and call it a day.
>> [...]
>
> That is the definition of a minimum. pred is the order relation and the  
> range gives the set. Ergo xyz=min. But that is were we are.

Except that min does not mean 'apply this ordering to this set, and then
do min on it' to most people. Extremum is a better choice not because it
better describes what it does, but precisely the opposite - people do not
intuitively 'understand' it, and thus look it up. That said, I agree
extremum is not a good name for xyz, but min is horrible.


>> What about ultimum? It means the last or the outermost.
>>
>
> As long as the function computes a least element, any names other than  
> leastElem* or min* are just confusing. 'ultimum' is not specific enough.  
> "Does it compute a least element or a greatest element?" The approach of  
> having a name that includes both max and min cannot work in a  
> satisfiable way for that reason.

Excepting of course the possibility that someone at some point might
read the documentation...


-- 
   Simen


More information about the Digitalmars-d mailing list