On Wed, Nov 7, 2018 at 10:10 PM Andrew Gierth <and...@tao11.riddles.org.uk>
wrote:

>
> But you don't need to create more functions, because you can do this:
>
> select largest(variadic array[1,2,3]);
>  largest
> ---------
>        3
>
>

> As already pointed out, greatest() and least() exist (though they were
> added before VARIADIC was, so they don't use it)
>
>
Yeah, I get that my four functions can collapse down to 2.  I was just
trying to say that if the greatest() and least() expressions did use
VARIADIC, that would collapse down to 0 additional functions. :)



>  Ken> 3) Bonus question--how come all the existing _larger and _smaller
>  Ken> functions are specific to each data type, as opposed to more
>  Ken> general smaller/larger functions?
>
> Because it saves looking up the type comparison function and doing an
> indirect call.
>
> That makes sense--thanks for the explanation!

Cheers,
Ken



-- 
AGENCY Software
A Free Software data system
By and for non-profits
*http://agency-software.org/ <http://agency-software.org/>*
*https://demo.agency-software.org/client
<https://demo.agency-software.org/client>*
ken.tan...@agency-software.org
(253) 245-3801

Subscribe to the mailing list
<agency-general-requ...@lists.sourceforge.net?body=subscribe> to
learn more about AGENCY or
follow the discussion.

Reply via email to