Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The universe is all a spin-off of the Big Bang.


devel / comp.lang.c / Heh heh... (Was: Recursion, Yo)

SubjectAuthor
* Recursion, YoLawrence D'Oliveiro
+* Re: Recursion, Yofir
|`* Re: Recursion, YoJanis Papanagnou
| +* Re: Recursion, YoLawrence D'Oliveiro
| |+* Re: Recursion, YoJanis Papanagnou
| ||`* Re: Recursion, YoBen Bacarisse
| || `* Re: Recursion, YoJanis Papanagnou
| ||  `* Re: Recursion, YoKeith Thompson
| ||   `- Re: Recursion, YoJanis Papanagnou
| |`- Re: Recursion, Yobart
| `* Re: Recursion, YoBen Bacarisse
|  +- Re: Recursion, YoBen Bacarisse
|  `* Re: Recursion, YoLawrence D'Oliveiro
|   +- Re: Recursion, YoChris M. Thomasson
|   +* Re: Recursion, YoDavid Brown
|   |+* Re: Recursion, YoLawrence D'Oliveiro
|   ||`* Re: Recursion, YoDavid Brown
|   || +* Re: Recursion, Yobart
|   || |+* Re: Recursion, YoDavid Brown
|   || ||`* Re: Recursion, YoLawrence D'Oliveiro
|   || || +* Re: Recursion, YoKaz Kylheku
|   || || |`* Heh heh... (Was: Recursion, Yo)Kenny McCormack
|   || || | `* Re: Heh heh... (Was: Recursion, Yo)Kaz Kylheku
|   || || |  `- Re: Heh heh... (Was: Recursion, Yo)Kenny McCormack
|   || || `* Re: Recursion, YoDavid Brown
|   || ||  +* Re: Recursion, YoScott Lurndal
|   || ||  |`* Re: Recursion, YoKaz Kylheku
|   || ||  | +* Re: Recursion, YoScott Lurndal
|   || ||  | |`* Re: Recursion, YoLawrence D'Oliveiro
|   || ||  | | +* Re: Recursion, YoKaz Kylheku
|   || ||  | | |`- Re: Recursion, YoDan Cross
|   || ||  | | `* Re: Recursion, YoJanis Papanagnou
|   || ||  | |  +* Re: Recursion, YoDavid Brown
|   || ||  | |  |`* Re: Recursion, YoJanis Papanagnou
|   || ||  | |  | +* Re: Recursion, YoDavid Brown
|   || ||  | |  | |`* Re: Recursion, YoJanis Papanagnou
|   || ||  | |  | | `- Re: Recursion, YoDavid Brown
|   || ||  | |  | `- Re: Recursion, YoLawrence D'Oliveiro
|   || ||  | |  +* Re: Recursion, YoLawrence D'Oliveiro
|   || ||  | |  |`* Re: Recursion, YoJanis Papanagnou
|   || ||  | |  | +- Re: Recursion, Yobart
|   || ||  | |  | `* Re: Recursion, YoLawrence D'Oliveiro
|   || ||  | |  |  +* Re: Recursion, YoMichael S
|   || ||  | |  |  |+* Re: Recursion, YoBen Bacarisse
|   || ||  | |  |  ||`* Re: Recursion, YoMichael S
|   || ||  | |  |  || `* Re: Recursion, YoJanis Papanagnou
|   || ||  | |  |  ||  `* Re: Recursion, YoKeith Thompson
|   || ||  | |  |  ||   `* Re: Recursion, YoBen Bacarisse
|   || ||  | |  |  ||    `* Re: Recursion, YoKeith Thompson
|   || ||  | |  |  ||     +* Re: Recursion, Yobart
|   || ||  | |  |  ||     |`- Re: Recursion, YoBen Bacarisse
|   || ||  | |  |  ||     `* Re: Recursion, YoJanis Papanagnou
|   || ||  | |  |  ||      +- Re: Recursion, YoJanis Papanagnou
|   || ||  | |  |  ||      `- Re: Recursion, YoKeith Thompson
|   || ||  | |  |  |`* Re: Recursion, YoLawrence D'Oliveiro
|   || ||  | |  |  | `- Re: Recursion, YoKeith Thompson
|   || ||  | |  |  `* Re: Recursion, YoJanis Papanagnou
|   || ||  | |  |   `* Re: Recursion, YoLawrence D'Oliveiro
|   || ||  | |  |    `* Re: Recursion, YoBen Bacarisse
|   || ||  | |  |     +* Re: Recursion, Yobart
|   || ||  | |  |     |`- Re: Recursion, YoBen Bacarisse
|   || ||  | |  |     `* Re: Recursion, YoLawrence D'Oliveiro
|   || ||  | |  |      +* Re: Recursion, YoChris M. Thomasson
|   || ||  | |  |      |+* Re: Recursion, YoBen Bacarisse
|   || ||  | |  |      ||`* Re: Recursion, YoLawrence D'Oliveiro
|   || ||  | |  |      || `* Re: Recursion, YoBen Bacarisse
|   || ||  | |  |      ||  `* Re: Recursion, YoLawrence D'Oliveiro
|   || ||  | |  |      ||   `- Re: Recursion, YoJanis Papanagnou
|   || ||  | |  |      |`* Re: Recursion, YoJanis Papanagnou
|   || ||  | |  |      | +* Re: Recursion, YoLawrence D'Oliveiro
|   || ||  | |  |      | |`- Re: Recursion, YoJanis Papanagnou
|   || ||  | |  |      | `* Re: Recursion, YoMichael S
|   || ||  | |  |      |  +* Re: Recursion, YoTim Rentsch
|   || ||  | |  |      |  |+* Re: Recursion, YoScott Lurndal
|   || ||  | |  |      |  ||+- Re: Recursion, YoKeith Thompson
|   || ||  | |  |      |  ||`- Re: Recursion, YoTim Rentsch
|   || ||  | |  |      |  |+* Re: Recursion, Yobart
|   || ||  | |  |      |  ||`* Re: Recursion, YoBen Bacarisse
|   || ||  | |  |      |  || +- Re: Recursion, YoKeith Thompson
|   || ||  | |  |      |  || `- Re: Recursion, YoKaz Kylheku
|   || ||  | |  |      |  |`* Re: Recursion, YoKeith Thompson
|   || ||  | |  |      |  | `- Re: Recursion, YoTim Rentsch
|   || ||  | |  |      |  `- Re: Recursion, YoJanis Papanagnou
|   || ||  | |  |      `- Re: Recursion, YoBen Bacarisse
|   || ||  | |  +* Re: Recursion, Yobart
|   || ||  | |  |+* Re: Recursion, YoJanis Papanagnou
|   || ||  | |  ||`- Re: Recursion, Yobart
|   || ||  | |  |`- Re: Recursion, YoKeith Thompson
|   || ||  | |  `- Re: Recursion, YoTim Rentsch
|   || ||  | `- Re: Recursion, YoDavid Brown
|   || ||  `* Re: Recursion, YoKeith Thompson
|   || ||   `- Re: Recursion, YoDavid Brown
|   || |`- Re: Recursion, Yofir
|   || +- Re: Recursion, YoJanis Papanagnou
|   || +* Re: Recursion, YoScott Lurndal
|   || |`* Re: Recursion, YoLawrence D'Oliveiro
|   || | `* Re: Recursion, YoScott Lurndal
|   || |  `- Re: Recursion, YoBen Bacarisse
|   || +* Re: Recursion, YoKaz Kylheku
|   || |`- Re: Recursion, YoDavid Brown
|   || `* Re: Recursion, YoLawrence D'Oliveiro
|   |`- Re: Recursion, YoKaz Kylheku
|   `- Re: Recursion, YoTim Rentsch
`- Re: Recursion, YoLawrence D'Oliveiro

Pages:12345
Re: Recursion, Yo

<uv6ond$1501o$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35026&group=comp.lang.c#35026

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Wed, 10 Apr 2024 21:19:09 +0200
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <uv6ond$1501o$1@dont-email.me>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<20240410101126.236@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 10 Apr 2024 21:19:10 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="628edf322d9c309c452a7d41af268394";
logging-data="1212472"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18XWGkqIwNJWGns6wjGJUB70sV6zfyH10s="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:mdSWyQ6F5RagNKdSU36Oo3yr7dM=
In-Reply-To: <20240410101126.236@kylheku.com>
Content-Language: en-GB
 by: David Brown - Wed, 10 Apr 2024 19:19 UTC

On 10/04/2024 19:19, Kaz Kylheku wrote:
> On 2024-04-10, David Brown <david.brown@hesbynett.no> wrote:
>> Basically, anything you could do with a nested function in gcc C you can
>> do in C++:
>
> Except pass that lambda to another module that expects a simple function
> pointer.

If the lambda has no captures, then you can do that. (I don't know if
this is supported by the C++ standards, or merely works in practice.)

>
> That's not just C libraries. There is a foreign function ecosystem based
> on the conventions of C. If you have a function pointer, you can pass it
> into any high level language that supports C interpo, and it can call
> that thing.
>

Re: Recursion, Yo

<uv7a4q$18qf8$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35032&group=comp.lang.c#35032

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Thu, 11 Apr 2024 00:16:26 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <uv7a4q$18qf8$2@dont-email.me>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<KhxRN.169893$t8cc.156830@fx06.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 11 Apr 2024 02:16:26 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d2a2395bdbcba38bc0f5ee97a1706bee";
logging-data="1337832"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19T0wEKZXX1uFKDbVcXPy5H"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:5LDIXs72Qrrno+Fs0THtGGHfAso=
 by: Lawrence D'Oliv - Thu, 11 Apr 2024 00:16 UTC

On Wed, 10 Apr 2024 14:23:38 GMT, Scott Lurndal wrote:

> The Burroughs Algol systems used something called lex levels to handle
> nested functions.

There are two techniques used in languages that allow nested scopes with
lexical binding: they are called “static link” and “display array”.

Re: Recursion, Yo

<uv7a8n$18qf8$3@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35033&group=comp.lang.c#35033

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Thu, 11 Apr 2024 00:18:31 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <uv7a8n$18qf8$3@dont-email.me>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<uv61f6$v1jm$1@dont-email.me> <uv68ok$11080$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 11 Apr 2024 02:18:31 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d2a2395bdbcba38bc0f5ee97a1706bee";
logging-data="1337832"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/erY9PWkr2oqOTZhE7b0KR"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:qXoJFuy2Dgz8HxVhoUIbZtAS3mI=
 by: Lawrence D'Oliv - Thu, 11 Apr 2024 00:18 UTC

On Wed, 10 Apr 2024 16:46:43 +0200, David Brown wrote:

> Just for your entertainment, with C++ lambdas this is now legal code:
>
> void foo(void) {
> [](){}();
> }

C programmer still has habit of writing “(void)” when C++ allows “()”
instead.

Does the latest C spec now also take “()” to mean “no args” (synonymous
with “(void)”) instead of “unspecified args”?

Re: Recursion, Yo

<20240410174139.914@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35034&group=comp.lang.c#35034

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Thu, 11 Apr 2024 00:54:41 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <20240410174139.914@kylheku.com>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<uv61f6$v1jm$1@dont-email.me> <uv68ok$11080$1@dont-email.me>
<uv7a8n$18qf8$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 11 Apr 2024 02:54:41 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0cee97af41ea72e01665d97a873fd1de";
logging-data="1370143"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19vVc6Vrrsxb0AcCnjgTHnKG0ZElJVZ/Bw="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:6eF0mYhLTY+jM2516IGMS3XVx9s=
 by: Kaz Kylheku - Thu, 11 Apr 2024 00:54 UTC

On 2024-04-11, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> On Wed, 10 Apr 2024 16:46:43 +0200, David Brown wrote:
>
>> Just for your entertainment, with C++ lambdas this is now legal code:
>>
>> void foo(void) {
>> [](){}();
>> }
>
> C programmer still has habit of writing “(void)” when C++ allows “()”
> instead.

That is backwards. (void) is the dud that C++ "allows"; () is the
"native" empty parameter list in C++, and has been from the early
beginning.

C++ (originally C With Classes) introduced () as a prototyped, declared
parameter list. At that time there was no (void) in C, and therefore not
in C++ either.

In C, the () list, in a declaration, didn't say anything about the
number of parameters.

ANSI C came along and invented (void) in order not to change the meaning
of () for compatibility.

Then C++ adopted (void) for ANSI C compatibility.

I.e. (void) is concession that that C++ "allows", and did not always;
() is the "native" empty parameter list it always had.

It's monumentally stupid when you see (void) on feature that only exists
in C++ and therefore C compatibility is not involved:

myclass::myclass(void)
{
// default constructor
}

> Does the latest C spec now also take “()” to mean “no args” (synonymous
> with “(void)”) instead of “unspecified args”?

The N3320 working draft says:

"The special case of an unnamed parameter of type void as the only item
in the list specifies that the function has no parameters."
(6.7.7.4 Function declarators)

"For a function declarator without a parameter type list: the effect is
as if it were declared with a parameter type list consisting of the
keyword void. A function declarator provides a prototype for the
function." (ibid.)

The last sentence assures us that function declartions are now protypes;
there are no function declarators that do not prototype the parameters.

(Apologies to Kenny for the "ibid.")

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Recursion, Yo

<uv7ccu$19nsd$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35035&group=comp.lang.c#35035

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Thu, 11 Apr 2024 00:54:54 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <uv7ccu$19nsd$1@dont-email.me>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 11 Apr 2024 02:54:54 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d2a2395bdbcba38bc0f5ee97a1706bee";
logging-data="1367949"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/l+DgBDyXXVHtqy7axiAKd"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:s6MpdwNABtVizfsQS/l+92zHNLM=
 by: Lawrence D'Oliv - Thu, 11 Apr 2024 00:54 UTC

On Wed, 10 Apr 2024 11:18:12 +0200, David Brown wrote:

> Basically, anything you could do with a nested function in gcc C you can
> do in C++:

Has anybody suggested adding coroutines to C++ yet?

E.g. Python equivalent to the permute function that uses a recursive
generator:

def permute(seq) :
if len(seq) == 0 :
yield ()
else :
for i in range(len(seq)) :
for rest in permute(seq[:i] + seq[i + 1:]) :
yield (seq[i],) + rest
#end for
#end for
#end if
#end permute

Example use:

for x in permute(("a", "b", "c")) :
print(x)
#end for

Output:

('a', 'b', 'c')
('a', 'c', 'b')
('b', 'a', 'c')
('b', 'c', 'a')
('c', 'a', 'b')
('c', 'b', 'a')

And then there’s the fun you can have with async/await ...

Re: Recursion, Yo

<20240410190522.179@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35037&group=comp.lang.c#35037

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Thu, 11 Apr 2024 02:06:00 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <20240410190522.179@kylheku.com>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<uv7ccu$19nsd$1@dont-email.me>
Injection-Date: Thu, 11 Apr 2024 04:06:01 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0cee97af41ea72e01665d97a873fd1de";
logging-data="1522863"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/RoF3dEgwD9sP6PqmbwoCWUkHd75AE4lk="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:oHaq+ujmmuEXzxvygRYxODRu45U=
 by: Kaz Kylheku - Thu, 11 Apr 2024 02:06 UTC

On 2024-04-11, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> Has anybody suggested adding coroutines to C++ yet?

Your training data isn't very recent, evidently.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Heh heh... (Was: Recursion, Yo)

<uv85ad$3l3n2$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35040&group=comp.lang.c#35040

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c
Subject: Heh heh... (Was: Recursion, Yo)
Date: Thu, 11 Apr 2024 08:00:13 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <uv85ad$3l3n2$1@news.xmission.com>
References: <uut24f$2icpb$1@dont-email.me> <uv68ok$11080$1@dont-email.me> <uv7a8n$18qf8$3@dont-email.me> <20240410174139.914@kylheku.com>
Injection-Date: Thu, 11 Apr 2024 08:00:13 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="3837666"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Thu, 11 Apr 2024 08:00 UTC

In article <20240410174139.914@kylheku.com>,
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
....
>(Apologies to Kenny for the "ibid.")

Heh heh. Got that one. Had to think for a minute or so, though.

Anyway, just for the record, I was specifically talking about things like
"ad hominem" - i.e., all those terms for supposedly bad arguments. Like
"ad populem" (Or however you spell it...) and so on.

Basically, I am saying that when someone uses the term "ad hominem", they
are conceding that they have lost the argument.

--
Trump has normalized hate.

The media has normalized Trump.

Re: Recursion, Yo

<uv867l$1j8l6$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35041&group=comp.lang.c#35041

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Thu, 11 Apr 2024 10:15:48 +0200
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <uv867l$1j8l6$1@dont-email.me>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<uv61f6$v1jm$1@dont-email.me> <uv68ok$11080$1@dont-email.me>
<uv7a8n$18qf8$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 11 Apr 2024 10:15:49 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="bfe965ad2c744120201e8335c561a037";
logging-data="1680038"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+kpWXb8RrcMA7xswc8X3tcgKoQPw+CrZs="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:DCor+xL9uLzp9raYRF0Vd5SThGk=
In-Reply-To: <uv7a8n$18qf8$3@dont-email.me>
Content-Language: en-GB
 by: David Brown - Thu, 11 Apr 2024 08:15 UTC

On 11/04/2024 02:18, Lawrence D'Oliveiro wrote:
> On Wed, 10 Apr 2024 16:46:43 +0200, David Brown wrote:
>
>> Just for your entertainment, with C++ lambdas this is now legal code:
>>
>> void foo(void) {
>> [](){}();
>> }
>
> C programmer still has habit of writing “(void)” when C++ allows “()”
> instead.

I do that sometimes, yes. I could argue that I think it is better to be
explicit than implicit, but it's just my fingers on automatic. The
kinds of programs I work on can rarely be pure C++ - there's always lots
of C code too, and it's often useful to write code in a way that is
suitable for both C and C++.

In this particular case, of course, there's not much advantage to having
a C-style function declaration!

>
> Does the latest C spec now also take “()” to mean “no args” (synonymous
> with “(void)”) instead of “unspecified args”?

It does, yes, in C23. If you want to declare a function with no
information about the number or type of parameters, you can now write
"void foo(...);". (Prior to C23 you needed at least one normal typed
parameter before the ellipsis.)

Re: Recursion, Yo

<uv86l7$1j8l6$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35042&group=comp.lang.c#35042

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Thu, 11 Apr 2024 10:23:03 +0200
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <uv86l7$1j8l6$2@dont-email.me>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<uv7ccu$19nsd$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 11 Apr 2024 10:23:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="bfe965ad2c744120201e8335c561a037";
logging-data="1680038"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/iDyJBMIvofqHw8WVCrtP1flYVKMRWtXc="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:dyVhB2squlzyS2c9MbS11Af/hq0=
In-Reply-To: <uv7ccu$19nsd$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Thu, 11 Apr 2024 08:23 UTC

On 11/04/2024 02:54, Lawrence D'Oliveiro wrote:
> On Wed, 10 Apr 2024 11:18:12 +0200, David Brown wrote:
>
>> Basically, anything you could do with a nested function in gcc C you can
>> do in C++:
>
> Has anybody suggested adding coroutines to C++ yet?
>

It's in C++20.

<https://en.cppreference.com/w/cpp/language/coroutines>

I have not looked at them myself, or checked the status of support in
C++ compilers and standard libraries.

Re: Recursion, Yo

<uv87at$1jdlr$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35043&group=comp.lang.c#35043

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Thu, 11 Apr 2024 08:34:37 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <uv87at$1jdlr$1@dont-email.me>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<uv7ccu$19nsd$1@dont-email.me> <uv86l7$1j8l6$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 11 Apr 2024 10:34:37 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d2a2395bdbcba38bc0f5ee97a1706bee";
logging-data="1685179"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+XMCsBgRK4dH+IPfQi8x8K"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:vYRP/PsglvY63Exl841WrxBuK0I=
 by: Lawrence D'Oliv - Thu, 11 Apr 2024 08:34 UTC

On Thu, 11 Apr 2024 10:23:03 +0200, David Brown wrote:

> On 11/04/2024 02:54, Lawrence D'Oliveiro wrote:
>
>> Has anybody suggested adding coroutines to C++ yet?
>>
> It's in C++20.
>
> <https://en.cppreference.com/w/cpp/language/coroutines>

Can’t have variadic arguments, and can’t be constructors.

In Python, “__init__()” cannot be async, but “__new__()” can. So you can
do async class instantiation, after all.

Re: Recursion, Yo

<WxSRN.161296$m4d.125974@fx43.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35045&group=comp.lang.c#35045

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!npeer.as286.net!npeer-ng0.as286.net!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx43.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Recursion, Yo
Newsgroups: comp.lang.c
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org> <uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk> <uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me> <uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me> <KhxRN.169893$t8cc.156830@fx06.iad> <uv7a4q$18qf8$2@dont-email.me>
Lines: 11
Message-ID: <WxSRN.161296$m4d.125974@fx43.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 11 Apr 2024 14:34:30 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 11 Apr 2024 14:34:30 GMT
X-Received-Bytes: 1349
 by: Scott Lurndal - Thu, 11 Apr 2024 14:34 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>On Wed, 10 Apr 2024 14:23:38 GMT, Scott Lurndal wrote:
>
>> The Burroughs Algol systems used something called lex levels to handle
>> nested functions.
>
>There are two techniques used in languages that allow nested scopes with
>lexical binding: they are called “static link” and “display array”.

What does that have to do with the Burroughs hardware support for
lexical levels?

Re: Recursion, Yo

<_zSRN.161297$m4d.144795@fx43.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35046&group=comp.lang.c#35046

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx43.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Recursion, Yo
Newsgroups: comp.lang.c
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org> <uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk> <uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me> <uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me> <uv61f6$v1jm$1@dont-email.me> <uv68ok$11080$1@dont-email.me> <uv7a8n$18qf8$3@dont-email.me> <uv867l$1j8l6$1@dont-email.me>
Lines: 19
Message-ID: <_zSRN.161297$m4d.144795@fx43.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 11 Apr 2024 14:36:42 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 11 Apr 2024 14:36:42 GMT
X-Received-Bytes: 1461
 by: Scott Lurndal - Thu, 11 Apr 2024 14:36 UTC

David Brown <david.brown@hesbynett.no> writes:
>On 11/04/2024 02:18, Lawrence D'Oliveiro wrote:
>> On Wed, 10 Apr 2024 16:46:43 +0200, David Brown wrote:
>>
>>> Just for your entertainment, with C++ lambdas this is now legal code:
>>>
>>> void foo(void) {
>>> [](){}();
>>> }
>>
>> C programmer still has habit of writing “(void)” when C++ allows “()”
>> instead.
>
>I do that sometimes, yes. I could argue that I think it is better to be
>explicit than implicit, but it's just my fingers on automatic.

I would use the same argument. Make it explicit.

Re: Recursion, Yo

<20240411075825.30@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35047&group=comp.lang.c#35047

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Thu, 11 Apr 2024 15:04:24 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <20240411075825.30@kylheku.com>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<uv61f6$v1jm$1@dont-email.me> <uv68ok$11080$1@dont-email.me>
<uv7a8n$18qf8$3@dont-email.me> <uv867l$1j8l6$1@dont-email.me>
<_zSRN.161297$m4d.144795@fx43.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 11 Apr 2024 17:04:25 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0cee97af41ea72e01665d97a873fd1de";
logging-data="1847540"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/a2Q9xp5qcdm4jpLKBEF9MuHO9WantOwk="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:uhjnWxIiP82XCVlN6seVl0z/Yvc=
 by: Kaz Kylheku - Thu, 11 Apr 2024 15:04 UTC

On 2024-04-11, Scott Lurndal <scott@slp53.sl.home> wrote:
> David Brown <david.brown@hesbynett.no> writes:
>>On 11/04/2024 02:18, Lawrence D'Oliveiro wrote:
>>> On Wed, 10 Apr 2024 16:46:43 +0200, David Brown wrote:
>>>
>>>> Just for your entertainment, with C++ lambdas this is now legal code:
>>>>
>>>> void foo(void) {
>>>> [](){}();
>>>> }
>>>
>>> C programmer still has habit of writing “(void)” when C++ allows “()”
>>> instead.
>>
>>I do that sometimes, yes. I could argue that I think it is better to be
>>explicit than implicit, but it's just my fingers on automatic.
>
> I would use the same argument. Make it explicit.

(void) is a dongle intoduced in ANSI C so that () could continue
to mean "unknown number of parameters". It didn't exist in C++
until ANSI C invented it.

() is a perfectly explicit empty list. (void) does not look empty;
it looks like it's declaring one parameter of type void.

An actual implicit empty parameter list might look like this:

function foo
{
}

Once you have empty parentheses, that is explicit.

Countless programming languages have only (); no such thing as (void) or
similar ugly hack, due to not having a quirky history that would have
caused such a thing to be required.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Heh heh... (Was: Recursion, Yo)

<20240411081303.407@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35048&group=comp.lang.c#35048

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: Heh heh... (Was: Recursion, Yo)
Date: Thu, 11 Apr 2024 15:13:53 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <20240411081303.407@kylheku.com>
References: <uut24f$2icpb$1@dont-email.me> <uv68ok$11080$1@dont-email.me>
<uv7a8n$18qf8$3@dont-email.me> <20240410174139.914@kylheku.com>
<uv85ad$3l3n2$1@news.xmission.com>
Injection-Date: Thu, 11 Apr 2024 17:13:54 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0cee97af41ea72e01665d97a873fd1de";
logging-data="1851183"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+x+0A1m5HZbT1zjKYDbC87lfVaCMeIL9c="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:WshZNj7QQfR+aFjRD0OkQ1NguF4=
 by: Kaz Kylheku - Thu, 11 Apr 2024 15:13 UTC

On 2024-04-11, Kenny McCormack <gazelle@shell.xmission.com> wrote:
> In article <20240410174139.914@kylheku.com>,
> Kaz Kylheku <643-408-1753@kylheku.com> wrote:
> ...
>>(Apologies to Kenny for the "ibid.")
>
> Heh heh. Got that one. Had to think for a minute or so, though.
>
> Anyway, just for the record, I was specifically talking about things like
> "ad hominem" - i.e., all those terms for supposedly bad arguments. Like
> "ad populem" (Or however you spell it...) and so on.
>
> Basically, I am saying that when someone uses the term "ad hominem", they
> are conceding that they have lost the argument.

Wait, isn't that "ad hit"? (adolf hitlerum)

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Recursion, Yo

<r8TRN.114606$Wbff.54968@fx37.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35049&group=comp.lang.c#35049

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!npeer.as286.net!npeer-ng0.as286.net!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx37.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Recursion, Yo
Newsgroups: comp.lang.c
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org> <uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk> <uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me> <uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me> <uv61f6$v1jm$1@dont-email.me> <uv68ok$11080$1@dont-email.me> <uv7a8n$18qf8$3@dont-email.me> <uv867l$1j8l6$1@dont-email.me> <_zSRN.161297$m4d.144795@fx43.iad> <20240411075825.30@kylheku.com>
Lines: 33
Message-ID: <r8TRN.114606$Wbff.54968@fx37.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 11 Apr 2024 15:15:35 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 11 Apr 2024 15:15:35 GMT
X-Received-Bytes: 2267
 by: Scott Lurndal - Thu, 11 Apr 2024 15:15 UTC

Kaz Kylheku <643-408-1753@kylheku.com> writes:
>On 2024-04-11, Scott Lurndal <scott@slp53.sl.home> wrote:
>> David Brown <david.brown@hesbynett.no> writes:

>>>I do that sometimes, yes. I could argue that I think it is better to be
>>>explicit than implicit, but it's just my fingers on automatic.
>>
>> I would use the same argument. Make it explicit.
>
>(void) is a dongle intoduced in ANSI C so that () could continue
>to mean "unknown number of parameters". It didn't exist in C++
>until ANSI C invented it.
>
>() is a perfectly explicit empty list. (void) does not look empty;
>it looks like it's declaring one parameter of type void.
>
>An actual implicit empty parameter list might look like this:
>
> function foo
> {
> }
>
>Once you have empty parentheses, that is explicit.
>
>Countless programming languages have only (); no such thing as (void) or
>similar ugly hack, due to not having a quirky history that would have
>caused such a thing to be required.

Beauty is in the eye of the beholder. As someone who cut his
teeth on Unix V6, an empty parameter list is less self-documenting
than an explicit (void).

We're talking about C and C++ here, not 'countless programming languages".

Re: Recursion, Yo

<uv9b8l$1rbtt$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35050&group=comp.lang.c#35050

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Thu, 11 Apr 2024 20:47:48 +0200
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <uv9b8l$1rbtt$1@dont-email.me>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<uv61f6$v1jm$1@dont-email.me> <uv68ok$11080$1@dont-email.me>
<uv7a8n$18qf8$3@dont-email.me> <uv867l$1j8l6$1@dont-email.me>
<_zSRN.161297$m4d.144795@fx43.iad> <20240411075825.30@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 11 Apr 2024 20:47:49 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="90e30c6ef7bcafc98b4a35b314c59c84";
logging-data="1945533"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1915ivNILIY7jHTf8Xc9/ukwl8tv1cyxpE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:1UrdNdImEPD+RPr031yLD20QhYc=
Content-Language: en-GB
In-Reply-To: <20240411075825.30@kylheku.com>
 by: David Brown - Thu, 11 Apr 2024 18:47 UTC

On 11/04/2024 17:04, Kaz Kylheku wrote:
> On 2024-04-11, Scott Lurndal <scott@slp53.sl.home> wrote:
>> David Brown <david.brown@hesbynett.no> writes:
>>> On 11/04/2024 02:18, Lawrence D'Oliveiro wrote:
>>>> On Wed, 10 Apr 2024 16:46:43 +0200, David Brown wrote:
>>>>
>>>>> Just for your entertainment, with C++ lambdas this is now legal code:
>>>>>
>>>>> void foo(void) {
>>>>> [](){}();
>>>>> }
>>>>
>>>> C programmer still has habit of writing “(void)” when C++ allows “()”
>>>> instead.
>>>
>>> I do that sometimes, yes. I could argue that I think it is better to be
>>> explicit than implicit, but it's just my fingers on automatic.
>>
>> I would use the same argument. Make it explicit.
>
> (void) is a dongle intoduced in ANSI C so that () could continue
> to mean "unknown number of parameters". It didn't exist in C++
> until ANSI C invented it.

I like history as much as the next person - probably more so, and thus I
do appreciate you explaining where this comes from. But I don't base my
programming choices or style on history. From the point of view of
current programming, it's irrelevant when "(void)" was introduced to C
and C++, it's only relevant what it means /now/ to the compiler, and
what it means to someone reading the code.

I write "(void)" in C code, or in C++ code that might be seen by a C
compiler (such as in a header file that could be used with C or C++), or
if it might be read by someone who is more familiar with C than C++. If
the code is "pure C++", such as this example, I normally don't bother
with "(void)". But I don't object to it either.

>
> () is a perfectly explicit empty list. (void) does not look empty;
> it looks like it's declaring one parameter of type void.

"void" has always been a bit weird as a "type" or as a placeholder for
an empty type.

>
> An actual implicit empty parameter list might look like this:
>
> function foo
> {
> }
>
> Once you have empty parentheses, that is explicit.
>

"(void)" stands out more.

> Countless programming languages have only (); no such thing as (void) or
> similar ugly hack, due to not having a quirky history that would have
> caused such a thing to be required.
>

It has never struck me as "ugly", but it is arguably quirky.

Re: Heh heh... (Was: Recursion, Yo)

<uv9cb0$3loll$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35051&group=comp.lang.c#35051

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c
Subject: Re: Heh heh... (Was: Recursion, Yo)
Date: Thu, 11 Apr 2024 19:06:08 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <uv9cb0$3loll$1@news.xmission.com>
References: <uut24f$2icpb$1@dont-email.me> <20240410174139.914@kylheku.com> <uv85ad$3l3n2$1@news.xmission.com> <20240411081303.407@kylheku.com>
Injection-Date: Thu, 11 Apr 2024 19:06:08 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="3859125"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Thu, 11 Apr 2024 19:06 UTC

In article <20240411081303.407@kylheku.com>,
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
>On 2024-04-11, Kenny McCormack <gazelle@shell.xmission.com> wrote:
>> In article <20240410174139.914@kylheku.com>,
>> Kaz Kylheku <643-408-1753@kylheku.com> wrote:
>> ...
>>>(Apologies to Kenny for the "ibid.")
>>
>> Heh heh. Got that one. Had to think for a minute or so, though.
>>
>> Anyway, just for the record, I was specifically talking about things like
>> "ad hominem" - i.e., all those terms for supposedly bad arguments. Like
>> "ad populem" (Or however you spell it...) and so on.
>>
>> Basically, I am saying that when someone uses the term "ad hominem", they
>> are conceding that they have lost the argument.
>
>Wait, isn't that "ad hit"? (adolf hitlerum)

I don't know what that means.

(T. Brennan - Yes, I've started watching "Bones" again...)

--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/Noam

Re: Recursion, Yo

<87cyqvg07s.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35052&group=comp.lang.c#35052

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Thu, 11 Apr 2024 12:37:11 -0700
Organization: None to speak of
Lines: 41
Message-ID: <87cyqvg07s.fsf@nosuchdomain.example.com>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<uv61f6$v1jm$1@dont-email.me> <uv68ok$11080$1@dont-email.me>
<uv7a8n$18qf8$3@dont-email.me> <uv867l$1j8l6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 11 Apr 2024 21:37:18 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0e70ff92e98e71e1faa57b3205b22b5a";
logging-data="1962409"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+li+nNWoclqgSHDL6hPdRw"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:rKSo93/duYKrOchFEWzPG7RMni0=
sha1:JYw7/D7tQSEDAc1RAngDGNCJfGA=
 by: Keith Thompson - Thu, 11 Apr 2024 19:37 UTC

David Brown <david.brown@hesbynett.no> writes:
> On 11/04/2024 02:18, Lawrence D'Oliveiro wrote:
>> On Wed, 10 Apr 2024 16:46:43 +0200, David Brown wrote:
>>
>>> Just for your entertainment, with C++ lambdas this is now legal code:
>>>
>>> void foo(void) {
>>> [](){}();
>>> }
>> C programmer still has habit of writing “(void)” when C++ allows
>> “()”
>> instead.
>
> I do that sometimes, yes. I could argue that I think it is better to
> be explicit than implicit, but it's just my fingers on automatic. The
> kinds of programs I work on can rarely be pure C++ - there's always
> lots of C code too, and it's often useful to write code in a way that
> is suitable for both C and C++.
>
> In this particular case, of course, there's not much advantage to
> having a C-style function declaration!
>
>> Does the latest C spec now also take “()” to mean “no args”
>> (synonymous
>> with “(void)”) instead of “unspecified args”?
>
> It does, yes, in C23. If you want to declare a function with no
> information about the number or type of parameters, you can now write
> "void foo(...);". (Prior to C23 you needed at least one normal typed
> parameter before the ellipsis.)

That's not quite the same. (...) declares a variadic function, whose
arguments (if any) can be accessed using the macros in <stdarg.h>.
Functions with an old-style () declaration can access their arguments by
names given in the definition Variadic functions could have a different
calling convention.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Re: Recursion, Yo

<87h6g7qz6n.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35053&group=comp.lang.c#35053

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Fri, 12 Apr 2024 00:04:00 +0100
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <87h6g7qz6n.fsf@bsb.me.uk>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<KhxRN.169893$t8cc.156830@fx06.iad> <uv7a4q$18qf8$2@dont-email.me>
<WxSRN.161296$m4d.125974@fx43.iad>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Fri, 12 Apr 2024 01:04:01 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="70d4b457fc2bf989eebe8ad07dbb8993";
logging-data="2055541"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX194ngjJXw7sxhIj9sO5GNmwi+hgzsu3p+c="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:vFhHhWFWhKSxSTRIZV1mhEXCDmI=
sha1:+lTraApGovEjFvnnb1scjhGy1a4=
X-BSB-Auth: 1.3493f04d098c998b5d0b.20240412000400BST.87h6g7qz6n.fsf@bsb.me.uk
 by: Ben Bacarisse - Thu, 11 Apr 2024 23:04 UTC

scott@slp53.sl.home (Scott Lurndal) writes:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>On Wed, 10 Apr 2024 14:23:38 GMT, Scott Lurndal wrote:
>>
>>> The Burroughs Algol systems used something called lex levels to handle
>>> nested functions.
>>
>>There are two techniques used in languages that allow nested scopes with
>>lexical binding: they are called "static link" and "display array".
>
> What does that have to do with the Burroughs hardware support for
> lexical levels?

I don't know all Burroughs hardware, but the famous B5000 accessed lex
levels using a set of 32 "D" registers. This is exactly what a "display
array" is. I suspect the register set's name (D) is a nod to the
conventional name for the technique.

PS. Can you get your newsreader to at least leave UTF-8 posting headers
un-changed? Passing the bytes through but removing the "charset"
declaration leads to mojibake.

--
Ben.

Re: Recursion, Yo

<uva6ep$24ji7$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35054&group=comp.lang.c#35054

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Fri, 12 Apr 2024 02:31:53 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <uva6ep$24ji7$1@dont-email.me>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<uv61f6$v1jm$1@dont-email.me> <uv68ok$11080$1@dont-email.me>
<uv7a8n$18qf8$3@dont-email.me> <uv867l$1j8l6$1@dont-email.me>
<_zSRN.161297$m4d.144795@fx43.iad> <20240411075825.30@kylheku.com>
<r8TRN.114606$Wbff.54968@fx37.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 12 Apr 2024 04:31:53 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c105d4bef0a9dfcc8267749d3ff10053";
logging-data="2248263"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18qTgjcJetMeGbZ8kmdjsgT"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:8oQ57PS1jQ/EIc6QUaRedQ6VBGg=
 by: Lawrence D'Oliv - Fri, 12 Apr 2024 02:31 UTC

On Thu, 11 Apr 2024 15:15:35 GMT, Scott Lurndal wrote:

> As someone who cut his teeth on
> Unix V6, an empty parameter list is less self-documenting than an
> explicit (void).

Should that apply when calling the function as well?

res = func(void);

instead of

res = func();

?

Re: Recursion, Yo

<20240411204846.381@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35055&group=comp.lang.c#35055

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Fri, 12 Apr 2024 03:51:49 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <20240411204846.381@kylheku.com>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<uv61f6$v1jm$1@dont-email.me> <uv68ok$11080$1@dont-email.me>
<uv7a8n$18qf8$3@dont-email.me> <uv867l$1j8l6$1@dont-email.me>
<_zSRN.161297$m4d.144795@fx43.iad> <20240411075825.30@kylheku.com>
<r8TRN.114606$Wbff.54968@fx37.iad> <uva6ep$24ji7$1@dont-email.me>
Injection-Date: Fri, 12 Apr 2024 05:51:49 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="86fea6ac8f9f905f0c8aab17577ad408";
logging-data="2275109"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18C4QD4X1HAzs7hOxgZX3OMRQkEfsltR5M="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:GZcn97cfSrqLoXaUFHtIbAa7cNY=
 by: Kaz Kylheku - Fri, 12 Apr 2024 03:51 UTC

On 2024-04-12, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> On Thu, 11 Apr 2024 15:15:35 GMT, Scott Lurndal wrote:
>
>> As someone who cut his teeth on
>> Unix V6, an empty parameter list is less self-documenting than an
>> explicit (void).
>
> Should that apply when calling the function as well?

Scott is getting burned by the current resident imbecile,
how embarrassing.

> res = func(void);
>
> instead of
>
> res = func();

Well, according to the eccentric coding conventions followed by your
team of one, indeed, yes; shouldn't it be:

res = func(/* void */);

No, wait:

res = func(
/* void = nothing */
); /* func( */

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Recursion, Yo

<uvah1j$26gtr$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35059&group=comp.lang.c#35059

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Fri, 12 Apr 2024 07:32:33 +0200
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <uvah1j$26gtr$1@dont-email.me>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<uv61f6$v1jm$1@dont-email.me> <uv68ok$11080$1@dont-email.me>
<uv7a8n$18qf8$3@dont-email.me> <uv867l$1j8l6$1@dont-email.me>
<_zSRN.161297$m4d.144795@fx43.iad> <20240411075825.30@kylheku.com>
<r8TRN.114606$Wbff.54968@fx37.iad> <uva6ep$24ji7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 12 Apr 2024 07:32:35 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3e64961bc4a57bf84ee9ec3ae5d82c42";
logging-data="2311099"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+cjnrUi3yX+8TrxIFObGDW"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:PtAUIw86eOkNA+Q5qPaSNIBDikc=
In-Reply-To: <uva6ep$24ji7$1@dont-email.me>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Fri, 12 Apr 2024 05:32 UTC

On 12.04.2024 04:31, Lawrence D'Oliveiro wrote:
> On Thu, 11 Apr 2024 15:15:35 GMT, Scott Lurndal wrote:
>
>> As someone who cut his teeth on
>> Unix V6, an empty parameter list is less self-documenting than an
>> explicit (void).
>
> Should that apply when calling the function as well?
>
> res = func(void);
>
> instead of
>
> res = func();
>
> ?

Ideally it would be (without syntactic ballast) just

res = func;

(as many programming languages have it designed), in
function definition and function call; no parameters,
no unnecessary parenthesis.

(Even Algol 68, where I've seen 'void' mentioned for
the first time, does not use 'void' for an empty
function argument list definition or function call.)

But we use C here, so we have to take what's given.

Janis

Re: Recursion, Yo

<uvanua$27qn8$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35062&group=comp.lang.c#35062

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Fri, 12 Apr 2024 09:30:18 +0200
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <uvanua$27qn8$1@dont-email.me>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<uv61f6$v1jm$1@dont-email.me> <uv68ok$11080$1@dont-email.me>
<uv7a8n$18qf8$3@dont-email.me> <uv867l$1j8l6$1@dont-email.me>
<_zSRN.161297$m4d.144795@fx43.iad> <20240411075825.30@kylheku.com>
<r8TRN.114606$Wbff.54968@fx37.iad> <uva6ep$24ji7$1@dont-email.me>
<uvah1j$26gtr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 12 Apr 2024 09:30:19 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="085f1be00dfebd806a614550c40cad96";
logging-data="2353896"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19P2NPJktlxjp/XvxQ+FBy5GH/0nj1yl5U="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:/5ZpcwJOQCrMxWHzOG5mWjBJD44=
Content-Language: en-GB
In-Reply-To: <uvah1j$26gtr$1@dont-email.me>
 by: David Brown - Fri, 12 Apr 2024 07:30 UTC

On 12/04/2024 07:32, Janis Papanagnou wrote:
> On 12.04.2024 04:31, Lawrence D'Oliveiro wrote:
>> On Thu, 11 Apr 2024 15:15:35 GMT, Scott Lurndal wrote:
>>
>>> As someone who cut his teeth on
>>> Unix V6, an empty parameter list is less self-documenting than an
>>> explicit (void).
>>
>> Should that apply when calling the function as well?
>>
>> res = func(void);
>>
>> instead of
>>
>> res = func();
>>
>> ?
>
> Ideally it would be (without syntactic ballast) just
>
> res = func;
>
> (as many programming languages have it designed), in
> function definition and function call; no parameters,
> no unnecessary parenthesis.
>
> (Even Algol 68, where I've seen 'void' mentioned for
> the first time, does not use 'void' for an empty
> function argument list definition or function call.)
>
> But we use C here, so we have to take what's given.
>

I prefer the consistency of function calls using parenthesis. The
consistent alternative, found in some other languages, is that they
never need parenthesis - "foo a b" calls "foo" with parameters "a" and "b".

(Of course you'd need some syntax for referring to the function itself,
or its address - "fp = &foo;" would not be too onerous, IMHO.)

Re: Recursion, Yo

<uvao71$27qit$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35063&group=comp.lang.c#35063

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Fri, 12 Apr 2024 07:34:57 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <uvao71$27qit$1@dont-email.me>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<uv61f6$v1jm$1@dont-email.me> <uv68ok$11080$1@dont-email.me>
<uv7a8n$18qf8$3@dont-email.me> <uv867l$1j8l6$1@dont-email.me>
<_zSRN.161297$m4d.144795@fx43.iad> <20240411075825.30@kylheku.com>
<r8TRN.114606$Wbff.54968@fx37.iad> <uva6ep$24ji7$1@dont-email.me>
<uvah1j$26gtr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 12 Apr 2024 09:34:58 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c105d4bef0a9dfcc8267749d3ff10053";
logging-data="2353757"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX194xo+bzeX9EIsV71mD16MM"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:yqTSpPjVeHYzbfQqOID94oLrzSU=
 by: Lawrence D'Oliv - Fri, 12 Apr 2024 07:34 UTC

On Fri, 12 Apr 2024 07:32:33 +0200, Janis Papanagnou wrote:

> Ideally it would be (without syntactic ballast) just
>
> res = func;

Then there is no way to express a reference to the function itself, as
distinct from a call to it.

Unless you do what Algol 68 did, and introduce the “deproceduring
coercion”, analogous to “dereferencing” which allowed doing away with any
explicit “address of x” and “the thingy whose address is in x” constructs.

> (Even Algol 68, where I've seen 'void' mentioned for the first time,
> does not use 'void' for an empty function argument list definition
> or function call.)

I just rechecked the Revised Report (always got to do it before opening my
mouth), and a “statement” is always “strong void”, which means any value
it returns can always be thrown away without having to explicitly say so.

But there are other contexts which are not “strong”, where fewer coercions
happen automatically.

Just did another check, and even in the weakest of syntactic contexts,
“soft”, implicit deproceduring is still allowed (but not implicit
dereferencing).

Re: Recursion, Yo

<uvaoea$27qn8$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35064&group=comp.lang.c#35064

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Fri, 12 Apr 2024 09:38:50 +0200
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <uvaoea$27qn8$2@dont-email.me>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
<uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
<uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
<uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
<uv61f6$v1jm$1@dont-email.me> <uv68ok$11080$1@dont-email.me>
<uv7a8n$18qf8$3@dont-email.me> <uv867l$1j8l6$1@dont-email.me>
<87cyqvg07s.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 12 Apr 2024 09:38:51 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="085f1be00dfebd806a614550c40cad96";
logging-data="2353896"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/PwpLGNYZiHFFOvUN7sz4OaH/x6+OgwqI="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:ZHtWI3WPVbXSXR+063Ocep2EZb8=
In-Reply-To: <87cyqvg07s.fsf@nosuchdomain.example.com>
Content-Language: en-GB
 by: David Brown - Fri, 12 Apr 2024 07:38 UTC

On 11/04/2024 21:37, Keith Thompson wrote:
> David Brown <david.brown@hesbynett.no> writes:
>> On 11/04/2024 02:18, Lawrence D'Oliveiro wrote:
>>> On Wed, 10 Apr 2024 16:46:43 +0200, David Brown wrote:
>>>
>>>> Just for your entertainment, with C++ lambdas this is now legal code:
>>>>
>>>> void foo(void) {
>>>> [](){}();
>>>> }
>>> C programmer still has habit of writing “(void)” when C++ allows
>>> “()”
>>> instead.
>>
>> I do that sometimes, yes. I could argue that I think it is better to
>> be explicit than implicit, but it's just my fingers on automatic. The
>> kinds of programs I work on can rarely be pure C++ - there's always
>> lots of C code too, and it's often useful to write code in a way that
>> is suitable for both C and C++.
>>
>> In this particular case, of course, there's not much advantage to
>> having a C-style function declaration!
>>
>>> Does the latest C spec now also take “()” to mean “no args”
>>> (synonymous
>>> with “(void)”) instead of “unspecified args”?
>>
>> It does, yes, in C23. If you want to declare a function with no
>> information about the number or type of parameters, you can now write
>> "void foo(...);". (Prior to C23 you needed at least one normal typed
>> parameter before the ellipsis.)
>
> That's not quite the same. (...) declares a variadic function, whose
> arguments (if any) can be accessed using the macros in <stdarg.h>.
> Functions with an old-style () declaration can access their arguments by
> names given in the definition Variadic functions could have a different
> calling convention.
>

Good point. Being able to write "T foo(...)" replaces any need to
declare pre-C23 "T foo()", but it is not a direct replacement without
changing code. (It might work as a replacement in practice for simple
cases, even though it is not required by the C standards - I don't know
how compatible ellipsis arguments are with declared arguments.)

There should, hopefully, be very little code from the last generation
that uses "T foo()" forms other than meaning "T foo(void)".


devel / comp.lang.c / Heh heh... (Was: Recursion, Yo)

Pages:12345
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor