Article View: comp.lang.c
Article #2041Re: variadic min and max, (any some and none, cat and more)
From: Lawrence D’Oliveiro
Date: Mon, 30 Nov 2026 21:34
Date: Mon, 30 Nov 2026 21:34
27 lines
2340 bytes
2340 bytes
On Mon, 30 Nov 2026 20:47:38 +0100, Bonita Montero wrote:
> Am 30.11.2026 um 19:49 schrieb Lawrence D’Oliveiro:
>
>> On Mon, 30 Nov 2026 19:44:50 +0100, Bonita Montero wrote:
>
>>> It's for sure more flexible since it can handle more variations of
>>> compatible types and it's for sure much fasger.
>
>> You betcha:
>>
>> >>> max("red", "green", "blue")
>> 'red'
>> >>> max(["red"], ["red", "green"], ["blue"])
>> ['red', 'green']
>>
>> Anything that has an ordering defined will work.
>
> In C++ you can write your own conversion to supply compatible types.
Python does custom operator overloads, too. And multiple inheritance.
And its core definition still ends up being only a small fraction of
the size of C++.
And unlike C++, and almost like Algol 68, it can do things that look
like custom operators, too
<https://gitlab.com/ldo/python_topics_notebooks/-/blob/master/Defining%20(Almost)%20Custom%20Operators.ipynb>.
Technical Details
Message-ID:
<11ekq4q$snda$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11bes8b$1gncr$1@dont-email.me> <11ek7b2$j8f6$1@raubtier-asyl.eternal-september.org> <11ekfu0$mq5n$4@dont-email.me> <11ekg71$n5p7$1@raubtier-asyl.eternal-september.org> <11ekgf8$mq5n$8@dont-email.me> <11ekjsp$pmch$2@raubtier-asyl.eternal-september.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Lawrence D’Oliveiro <ldo@nz.invalid> Newsgroups: comp.lang.c Subject: Re: variadic min and max, (any some and none, cat and more) Date: Mon, 30 Nov 2026 21:34:18 -0000 (UTC) Organization: A noiseless patient Spider Lines: 27 Message-ID: <11ekq4q$snda$1@dont-email.me> References: <11bes8b$1gncr$1@dont-email.me> <11ek7b2$j8f6$1@raubtier-asyl.eternal-september.org> <11ekfu0$mq5n$4@dont-email.me> <11ekg71$n5p7$1@raubtier-asyl.eternal-september.org> <11ekgf8$mq5n$8@dont-email.me> <11ekjsp$pmch$2@raubtier-asyl.eternal-september.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 30 Nov 2026 21:34:19 +0000 (UTC) Injection-Info: dont-email.me; logging-data="941482"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Y5bEMKFiBE6MG13OsU5AN"; posting-host="a13339aa161941cd02c77e7c540602f1" User-Agent: Pan/0.165 (Kostiantynivka) Cancel-Lock: sha1:dMZJV3tdcLlx11G0s0WNh/oWbP8= sha256:F7KHmcqcqXDhDqU5nLSmg4xGSnUFhj1olobSR0+hX6Y= sha1:me5FmYx/+4CSHPhSYbwAOkrxL3Q= sha256:52MeymYokIji6fkqWZn3RxFBBJKIPWP0Ewpe60veiXc=