Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Oh, so there you are!


devel / comp.lang.c / Re: 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

<uvavfe$29dgd$1@dont-email.me>

  copy mid

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

  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: bc...@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Fri, 12 Apr 2024 10:38:52 +0100
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <uvavfe$29dgd$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 11:38:54 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b4e55c9728b3282b5449551fe3e50c2b";
logging-data="2405901"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19X6SceL39BI4XjrZQwPvRi"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:vS6H0Njge7h+luDCPdr7P0aGuA8=
In-Reply-To: <uvah1j$26gtr$1@dont-email.me>
Content-Language: en-GB
 by: bart - Fri, 12 Apr 2024 09:38 UTC

On 12/04/2024 06: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();

(What happens in Python when 'func' has multiple /optional/ parameters
which have all been omitted; do you need to document them in the call to
distinguish this from a call to a function which genuinely has no
arguments?)

>>
>> ?
>
> 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.

I used to allow 'func' to call a function with no args. Later I switched
to using func() as being more informative, since just:

func

doesn't impart very much. Maybe it's a function call; maybe it's a goto
to label 'func' (as I still allow); maybe it's a macro invocation; maybe
it's just evaluating a variable 'func' then discarding the value.

Using func() becomes more necessary with dynamic code; if P is a
reference to a function, then what does this mean:

Q := P

Is this copying the reference to Q, or calling P() and copying the
result? Using &P to disambiguate won't work here: that will create a
reference to the reference!

So F() is really doing CALL F; it's making it explicit.

Re: Recursion, Yo

<uvb9r4$2c31v$1@dont-email.me>

  copy mid

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

  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 14:35:47 +0200
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <uvb9r4$2c31v$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> <uvao71$27qit$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 14:35:49 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3e64961bc4a57bf84ee9ec3ae5d82c42";
logging-data="2493503"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+x1Kytt7l0oxVEaYfCcSSL"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:hubf/47dUTNzhFb++MEf8UxVEgo=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <uvao71$27qit$1@dont-email.me>
 by: Janis Papanagnou - Fri, 12 Apr 2024 12:35 UTC

On 12.04.2024 09:34, Lawrence D'Oliveiro wrote:
> 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.

It seems that's one of the fundamental differences between (low-level)
languages that want to provide such technical factors explicit to the
user and between languages that want to provide a higher abstraction.

Algol 60, Pascal, Simula 67 and Algol 60, Eiffel, etc. all took that
approach.

Languages syntactically derived from C or borrowed its syntax didn't.

It's, BTW, one of the reasons I like all these languages and not only
from a conceptual point of view, but by far not the only reason; the
way that programmers are not forced to consider low-level technical
stuff but can focus on the algorithm. Some things should be the task
of the compiler, not the programmer. A lot of inherent issues with C
stem from it's low-level design.

>
>> (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.

In Algol 68 everything is an expression. Statements are of type 'void'.
You have, to keep it most simple here, for example,

PROC f = INT : 3.1415

PROC p = VOID : SKIP

There's nothing "thrown away" (as in C). This is a completely different
view, and a different path that C has chosen to go, where everything is
a function (as they say).

> [ snip ]

Janis

Re: Recursion, Yo

<uvbapb$5ep$1@reader1.panix.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
From: cro...@spitfire.i.gajendra.net (Dan Cross)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Fri, 12 Apr 2024 12:51:55 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <uvbapb$5ep$1@reader1.panix.com>
References: <uut24f$2icpb$1@dont-email.me> <r8TRN.114606$Wbff.54968@fx37.iad> <uva6ep$24ji7$1@dont-email.me> <20240411204846.381@kylheku.com>
Injection-Date: Fri, 12 Apr 2024 12:51:55 -0000 (UTC)
Injection-Info: reader1.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
logging-data="5593"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: cross@spitfire.i.gajendra.net (Dan Cross)
 by: Dan Cross - Fri, 12 Apr 2024 12:51 UTC

In article <20240411204846.381@kylheku.com>,
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
>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( */

LOL. Despite punching down, that was very funny.

- Dan C.

Re: Recursion, Yo

<uvbbed$2cdhc$1@dont-email.me>

  copy mid

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

  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 15:03:08 +0200
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <uvbbed$2cdhc$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> <uvanua$27qn8$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 15:03:10 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3e64961bc4a57bf84ee9ec3ae5d82c42";
logging-data="2504236"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Tj4ETz/bkSizHFHD+aPBk"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:mudPC+q56wG9gbXiQJqzjgJs1M8=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <uvanua$27qn8$1@dont-email.me>
 by: Janis Papanagnou - Fri, 12 Apr 2024 13:03 UTC

On 12.04.2024 09:30, David Brown wrote:
>
> 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".

Mind that this is just one "consistency" aspect.

Another one is that you can write (e.g. in Algol 68 or many other
higher level languages) the equivalent of - again a simple example -

int x = 2 * pi * r

without necessity to know whether pi is a constant, the result of a
function (calculation), the result of a function implicitly called
just once on demand, or whatever else. Conceptually as a programming
language user you want the value.

I don't say one or the other is "better", just that consistence is
not an absolute property. (But also that Algol 68, WRT a consistent
formal language design, is indeed very different from C in quality.)

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

All repliers to my post mentioned references or addresses; I think,
beyond personal preferences, it is a key observation that this is
unnecessary if the language (and its compiler) handles that per its
semantics. In Algol 68 you can define fp = foo but you don't need
an "address value" introduced.

Preferences are probably heavily influenced by the set of languages
one started with, so it's not useful to dispute here. But I think it's
noteworthy to anticipate that it's not a "legacy" thing with languages
that evolved around 1967 to 1972; Eiffel and other important languages
(I think also Ada) later also took that path. It's also noteworthy
that these languages focus on programming safety; and I suppose that
there's no dissent here about the programming safety in C as opposed
to the languages mentioned in the other reply I just gave.

Janis

Re: Recursion, Yo

<uvbbn6$2cequ$1@dont-email.me>

  copy mid

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

  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 15:07:49 +0200
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <uvbbn6$2cequ$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> <uvavfe$29dgd$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 15:07:51 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3e64961bc4a57bf84ee9ec3ae5d82c42";
logging-data="2505566"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18mrbiXv8NaiwrQV3cM5xOp"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:lCrMYvZA9bOhMxCTuiyWoppeI9c=
In-Reply-To: <uvavfe$29dgd$1@dont-email.me>
 by: Janis Papanagnou - Fri, 12 Apr 2024 13:07 UTC

On 12.04.2024 11:38, bart wrote:
>
> I used to allow 'func' to call a function with no args. Later I switched
> to using func() as being more informative, since just:
>
> func

I wasn't aware that C allows that. (Or are you talking about your own
language(s) here?)

>
> doesn't impart very much. Maybe it's a function call; maybe it's a goto
> to label 'func' (as I still allow); maybe it's a macro invocation; maybe
> it's just evaluating a variable 'func' then discarding the value.

You seem to be writing that [since] you "allow" a lot of non-standard
things thus needing some syntax to restrict that initial freedom again.

Anyway; I have no connection to your tools (if that's what you were
speaking about), so I abstain.

Janis

> [...]

Re: Recursion, Yo

<uvbhph$2do64$1@dont-email.me>

  copy mid

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

  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 16:51:28 +0200
Organization: A noiseless patient Spider
Lines: 69
Message-ID: <uvbhph$2do64$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> <uvanua$27qn8$1@dont-email.me>
<uvbbed$2cdhc$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 16:51:29 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="085f1be00dfebd806a614550c40cad96";
logging-data="2547908"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19hS4Ng9t7Q/BxCH26iws8tv/yzlfOk/uk="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:axU02Fz9Z3gTmEMaBFkFGS3oTNA=
In-Reply-To: <uvbbed$2cdhc$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Fri, 12 Apr 2024 14:51 UTC

On 12/04/2024 15:03, Janis Papanagnou wrote:
> On 12.04.2024 09:30, David Brown wrote:
>>
>> 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".
>
> Mind that this is just one "consistency" aspect.

True.

>
> Another one is that you can write (e.g. in Algol 68 or many other
> higher level languages) the equivalent of - again a simple example -
>
> int x = 2 * pi * r
>
> without necessity to know whether pi is a constant, the result of a
> function (calculation), the result of a function implicitly called
> just once on demand, or whatever else. Conceptually as a programming
> language user you want the value.
>

But is that a good thing? For some programming, especially with
higher-level languages, then it is fine. For other types of
programming, you want to know if functions are called in order to have a
better idea of the flow of control and the efficiency of the code, plus
perhaps thread safety.

> I don't say one or the other is "better", just that consistence is
> not an absolute property.

Fair enough, and I agree that this is not a matter that has a single
correct answer. It is not uncommon that being consistent in one way
necessitates being inconsistent in another way.

Just for fun, this is a way to let you define a function-like object
"pi" in C++ that is called automatically, without parentheses :

#include <numbers>

template <auto f>
class Auto_executor {
public :
using T = decltype(f());
operator T () {
return f();
}
};

static Auto_executor<[](){ return std::numbers::pi; }> pi;

double circumferance(double r) {
return 2 * pi * r;
}

I am not giving an opinion as to whether or not this is a good idea (and
obviously it is completely redundant in the case of a compile-time
constant). Some people might think C++ is great because it lets you use
tricks like this, some people might think C++ is terrible because it
lets you use tricks like this :-)

Re: Recursion, Yo

<uvbkhq$2ean1$1@dont-email.me>

  copy mid

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

  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: bc...@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Fri, 12 Apr 2024 16:38:33 +0100
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <uvbkhq$2ean1$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> <uvavfe$29dgd$1@dont-email.me>
<uvbbn6$2cequ$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 17:38:35 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b4e55c9728b3282b5449551fe3e50c2b";
logging-data="2566881"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18FqUb8FGdSk9Ju8ItTiHL+"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:fAd1E1cXRVcifGLNi4f/EQkIGmQ=
In-Reply-To: <uvbbn6$2cequ$1@dont-email.me>
Content-Language: en-GB
 by: bart - Fri, 12 Apr 2024 15:38 UTC

On 12/04/2024 14:07, Janis Papanagnou wrote:
> On 12.04.2024 11:38, bart wrote:
>>
>> I used to allow 'func' to call a function with no args. Later I switched
>> to using func() as being more informative, since just:
>>
>> func
>
> I wasn't aware that C allows that. (Or are you talking about your own
> language(s) here?)

In my language I used to allow 'func' for a function call with no args
until I decided to require 'func()'.

>>
>> doesn't impart very much. Maybe it's a function call; maybe it's a goto
>> to label 'func' (as I still allow); maybe it's a macro invocation; maybe
>> it's just evaluating a variable 'func' then discarding the value.

Re: Recursion, Yo

<uvbko8$2ean1$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Fri, 12 Apr 2024 16:42:00 +0100
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <uvbko8$2ean1$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>
<_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> <uvao71$27qit$1@dont-email.me>
<uvb9r4$2c31v$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 12 Apr 2024 17:42:00 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b4e55c9728b3282b5449551fe3e50c2b";
logging-data="2566881"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18YJ9u0EVY401J49bt9ClX0"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:bjqI9FSSa1w1ryn4LMatxXyT6iQ=
In-Reply-To: <uvb9r4$2c31v$1@dont-email.me>
Content-Language: en-GB
 by: bart - Fri, 12 Apr 2024 15:42 UTC

On 12/04/2024 13:35, Janis Papanagnou wrote:
> On 12.04.2024 09:34, Lawrence D'Oliveiro wrote:
>> 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.
>
> It seems that's one of the fundamental differences between (low-level)
> languages that want to provide such technical factors explicit to the
> user and between languages that want to provide a higher abstraction.
>
> Algol 60, Pascal, Simula 67 and Algol 60, Eiffel, etc. all took that
> approach.
>
> Languages syntactically derived from C or borrowed its syntax didn't.

You don't say anything about C itself. C sometimes is explicit and
sometimes it isn't:

&F; // both take the address of a function F
F;

P(); // both call a function via a pointer P
(*P)();

So you can use an explicit & or * operator, not not.

Re: Recursion, Yo

<uvcihh$2kbfj$5@dont-email.me>

  copy mid

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

  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: Sat, 13 Apr 2024 00:10:25 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <uvcihh$2kbfj$5@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> <uvanua$27qn8$1@dont-email.me>
<uvbbed$2cdhc$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 13 Apr 2024 02:10:26 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c07c9bb19a0975fd36cf4a2cbd5e0704";
logging-data="2764275"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/64kAN4paPLosgKVrCffls"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:3v8O/0LO4MlE/mgsI+wqcZZ1R4U=
 by: Lawrence D'Oliv - Sat, 13 Apr 2024 00:10 UTC

On Fri, 12 Apr 2024 15:03:08 +0200, Janis Papanagnou wrote:

> Another one is that you can write (e.g. in Algol 68 or many other higher
> level languages) the equivalent of - again a simple example -
>
> int x = 2 * pi * r
>
> without necessity to know whether pi is a constant, the result of a
> function (calculation), the result of a function implicitly called just
> once on demand, or whatever else. Conceptually as a programming language
> user you want the value.

In Python you can’t do this with an unqualified name, but you can with a
qualified one, e.g.

x = 2 * math.pi * r

Which one of these might be true?

* “math” is a module, and “pi” is a variable defined within it
* “math” is a class, and “pi” is a variable defined within it
* “math” is an instance of a class, and “pi” is a variable defined either
within that instance or the class
* “math” is an instance of a class, and “pi” is a “property”, which is
computing a value, on demand, via an implicit method call

Note that the fourth possibility does an implicit method call without
argument parentheses.

Re: Recursion, Yo

<uvcing$2kbfj$6@dont-email.me>

  copy mid

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

  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: Sat, 13 Apr 2024 00:13:36 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <uvcing$2kbfj$6@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> <uvao71$27qit$1@dont-email.me>
<uvb9r4$2c31v$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 13 Apr 2024 02:13:37 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c07c9bb19a0975fd36cf4a2cbd5e0704";
logging-data="2764275"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+LlLcqy7YCOpLHbhMak/yu"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:XKpaMICTzC+lPEjxOIywUuvReYM=
 by: Lawrence D'Oliv - Sat, 13 Apr 2024 00:13 UTC

On Fri, 12 Apr 2024 14:35:47 +0200, Janis Papanagnou wrote:

> It seems that's one of the fundamental differences between (low-level)
> languages that want to provide such technical factors explicit to the
> user and between languages that want to provide a higher abstraction.
>
> Algol 60, Pascal, Simula 67 and Algol 60, Eiffel, etc. all took that
> approach.

Pascal had explicit pointers, though. Algol 68 and Ada did not.

> Languages syntactically derived from C or borrowed its syntax didn't.

Is there anything higher level than λ-calculus? In that notation, you
always know whether you are referring to a function, or calling it.

Lisp makes function calls explicit in the same way. And no one would
accuse it of “deriving from C”, given that it originated about a decade
earlier.

> In Algol 68 everything is an expression. Statements are of type 'void'.
> You have, to keep it most simple here, for example,
>
> PROC f = INT : 3.1415
>
> PROC p = VOID : SKIP
>
> There's nothing "thrown away" (as in C).

Yes there is--it’s called “voiding”.

Re: Recursion, Yo

<878r1if22p.fsf@nosuchdomain.example.com>

  copy mid

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

  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: Fri, 12 Apr 2024 19:06:54 -0700
Organization: None to speak of
Lines: 44
Message-ID: <878r1if22p.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>
<_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> <uvavfe$29dgd$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sat, 13 Apr 2024 04:06:55 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="aecb403ab47f313fa7e3f724652ac7a7";
logging-data="2807090"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX195G77HDbEdbz/FPlT65h9m"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:zayRRJLNcle3gLXAnbtgBdKXWO0=
sha1:QZf6FVGpQKDmgqgUG/R0xJD8ut0=
 by: Keith Thompson - Sat, 13 Apr 2024 02:06 UTC

bart <bc@freeuk.com> writes:
> On 12/04/2024 06: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();
>
> (What happens in Python when 'func' has multiple /optional/ parameters
> which have all been omitted; do you need to document them in the call
> to distinguish this from a call to a function which genuinely has no
> arguments?)

Nothing special. Python requires parentheses on all function calls.
res = func() assigns to res the value returned by the function func.
res = func assigns to res a value of type "function".

It's similar to what C does, except that in C there's no way res can be
assignment-compatible with both func and func().

In Ada, a procedure or function call with no arguments doesn't use
parentheses:

res := func;

Ada has no values of function type (which is why it can get away with
omitting parentheses for calls with no arguments), though it does have
are the equivalent of pointers to functions. (The lack of parentheses
on calls with no arguments is something that always annoyed me about
Ada.)

--
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

<8634rpz5ek.fsf@linuxsc.com>

  copy mid

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

  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: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Sat, 13 Apr 2024 07:46:59 -0700
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <8634rpz5ek.fsf@linuxsc.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> <uvah1j$26gtr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Sat, 13 Apr 2024 16:46:59 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="44a1207aeaadfda1483c7b96a3737e57";
logging-data="3216084"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+1KVr2omkb4/LXOQXZvVZpVdCzFpBbBY="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:4VNHd51ijUJI7VL+iP0UAI4BtqE=
sha1:hYp0JtyYU1xmZnnDaZ4t38qu4E4=
 by: Tim Rentsch - Sat, 13 Apr 2024 14:46 UTC

Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:

> [properties of some other languages]
>
> But we use C here, so we have to take what's given.

It would be nice if more participants in this newsgroup
would follow that precept.

Re: Recursion, Yo

<uveeo1$33v1t$1@dont-email.me>

  copy mid

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

  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: Sat, 13 Apr 2024 19:17:53 +0200
Organization: A noiseless patient Spider
Lines: 82
Message-ID: <uveeo1$33v1t$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> <uvanua$27qn8$1@dont-email.me>
<uvbbed$2cdhc$1@dont-email.me> <uvbhph$2do64$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 13 Apr 2024 19:17:54 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="631a0b1dedfa84c6e863811882d6f518";
logging-data="3275837"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/t/qB0VAEpxpAN2qn0cjF/"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:h+LiwiitamweQ1XGmko9ugIau8Q=
In-Reply-To: <uvbhph$2do64$1@dont-email.me>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Sat, 13 Apr 2024 17:17 UTC

On 12.04.2024 16:51, David Brown wrote:
> On 12/04/2024 15:03, Janis Papanagnou wrote:
>>
>> Another one is that you can write (e.g. in Algol 68 or many other
>> higher level languages) the equivalent of - again a simple example -
>>
>> int x = 2 * pi * r
>>
>> without necessity to know whether pi is a constant, the result of a
>> function (calculation), the result of a function implicitly called
>> just once on demand, or whatever else. Conceptually as a programming
>> language user you want the value.
>>
>
> But is that a good thing?

In my book it is a good thing (but I wouldn't overestimate it)...

> For some programming, especially with
> higher-level languages, then it is fine. For other types of
> programming, you want to know if functions are called in order to have a
> better idea of the flow of control and the efficiency of the code, plus
> perhaps thread safety.

....because the (in practice valid!) topics you mention _should_ not
be of concern to the programmer. The "idea of the flow" should, IMO,
certainly not depend on parenthesis. I'll try an example from a C++
context... - Say, I want to get the "length" of a container. What I
indeed care about is the complexity of that operation, but that
should be part of the library specification. C++/STL provides me
with O(1), O(N), O(x) information that I can count on. Though the
procedure to determine some length() might depend on the type of
the container; it may be just an attribute access, it might be a
difference computation (last-first+1), or it might be an iteration.
Despite that could be hidden in a function length() you need the
O(x) information to be sure about efficiency. (Or to look into the
function's source code of the function, if available, to analyze
the algorithm.)

What I'm basically trying to say is that length() doesn't provide
the certainty or information that one needs or likes to have. All
it provides is a syntactical, technical detail of the language.
With it you get the uncertainty of "Uh-oh, there's parentheses;
now does it mean that it's expensive to use it?" - But you don't
get relevant information from the parentheses!

For the [general, non-C] programmer it's (IMO) clearer to not put
(unnecessary) syntactical burden on him. He wants a value 'len'?
He just gets the value 'len' (and not len())!

I think I've already said that it's to a large degree probably
personal experience and preferences whether one comes to the
conclusion that it's a good thing, a bad thing, or even "mostly
harmless" (meaningless).

(These are the thoughts from someone who did not start his CS life
with C-like languages. From someone who has seen a lot of languages
with good concepts that needed decades to only slowly - if at all -
find their way into the modern, mainstream, or hyped languages. I
thought that evolution in programming languages would benefit from
good concepts. But "Not Invented Here" principle seems to dominate.
<end-of-rant>)

>
> Just for fun, this is a way to let you define a function-like object
> "pi" in C++ that is called automatically, without parentheses :
> [...]
> I am not giving an opinion as to whether or not this is a good idea (and
> obviously it is completely redundant in the case of a compile-time
> constant). Some people might think C++ is great because it lets you use
> tricks like this, some people might think C++ is terrible because it
> lets you use tricks like this :-)

(Nice example.) - Well, to me C++ is (or was) great because it
supported what I've learned to love from using Simula; classes
and inheritance, the whole OO paradigm, "living objects" and a
lot more that's still "undiscovered" by other languages. What I
found terrible was that it inherited the whole uncertainty from
using a low level language like C.

Janis

Re: Recursion, Yo

<20240413203303.000001f9@yahoo.com>

  copy mid

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

  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: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Sat, 13 Apr 2024 20:33:03 +0300
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <20240413203303.000001f9@yahoo.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>
<uvah1j$26gtr$1@dont-email.me>
<uvao71$27qit$1@dont-email.me>
<uvb9r4$2c31v$1@dont-email.me>
<uvcing$2kbfj$6@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 13 Apr 2024 19:33:09 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0a8afe053ad1c3112879cfddaae1d3d7";
logging-data="3274443"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+bFyV28mQC4uUIunRxWfJOb7WK/DZmgRw="
Cancel-Lock: sha1:lSRppa5szSNrLO36Q1twOQrdkyw=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
 by: Michael S - Sat, 13 Apr 2024 17:33 UTC

On Sat, 13 Apr 2024 00:13:36 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:

> On Fri, 12 Apr 2024 14:35:47 +0200, Janis Papanagnou wrote:
>
> > It seems that's one of the fundamental differences between
> > (low-level) languages that want to provide such technical factors
> > explicit to the user and between languages that want to provide a
> > higher abstraction.
> >
> > Algol 60, Pascal, Simula 67 and Algol 60, Eiffel, etc. all took that
> > approach.
>
> Pascal had explicit pointers, though. Algol 68 and Ada did not.
>

Of course, Ada has pointers. The are called access types.
https://en.wikibooks.org/wiki/Ada_Programming/Types/access

I never learned Algol-68, but considering your reputation I'd want to
see confirmation from more reliable source.

Re: Recursion, Yo

<uveft2$346sv$1@dont-email.me>

  copy mid

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

  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: Sat, 13 Apr 2024 19:37:37 +0200
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <uveft2$346sv$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> <uvao71$27qit$1@dont-email.me>
<uvb9r4$2c31v$1@dont-email.me> <uvcing$2kbfj$6@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 13 Apr 2024 19:37:38 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="631a0b1dedfa84c6e863811882d6f518";
logging-data="3283871"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19oZyYvNZFop+L93YgRKCg5"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:n0ucq4Xp2S0pfLNucdLsaKFolaE=
In-Reply-To: <uvcing$2kbfj$6@dont-email.me>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Sat, 13 Apr 2024 17:37 UTC

On 13.04.2024 02:13, Lawrence D'Oliveiro wrote:
> On Fri, 12 Apr 2024 14:35:47 +0200, Janis Papanagnou wrote:
>
>> It seems that's one of the fundamental differences between (low-level)
>> languages that want to provide such technical factors explicit to the
>> user and between languages that want to provide a higher abstraction.
>>
>> Algol 60, Pascal, Simula 67 and Algol 60, Eiffel, etc. all took that
>> approach.
>
> Pascal had explicit pointers, though. Algol 68 and Ada did not.

Pascal has pointers bound to the object (as opposed to C pointers).
It's similar in Algol 68 were you model your complex linked object
structures with "references" on the heap. (WRT Ada, I'm not deeply
familiar with it, so cannot tell.)

> [...]
>
>> In Algol 68 everything is an expression. Statements are of type 'void'.
>> You have, to keep it most simple here, for example,
>>
>> PROC f = INT : 3.1415
>>
>> PROC p = VOID : SKIP
>>
>> There's nothing "thrown away" (as in C).
>
> Yes there is--it’s called “voiding”.

What do you mean - mind to elaborate with examples? (Then it will
be simpler for me to explain our probably different views.)

For the moment I just want to expand on the samples above (and
thereby fixing the INT/REAL typo)...

PROC f = REAL : 3.1415;
PROC p = VOID : SKIP;

PROC n = VOID : 2.71828;
PROC q = REAL : SKIP;

REAL x = f;
p;
REAL y = n;
q;
REAL z = q;

This is *not* functioning Algol 68 code! - But maybe you can explain
where or how there's something "thrown away".

I suppose you have something in mind like C's (void) f(); ?

Janis

Re: Recursion, Yo

<uveheu$34hm7$1@dont-email.me>

  copy mid

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

  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: Sat, 13 Apr 2024 20:04:14 +0200
Organization: A noiseless patient Spider
Lines: 122
Message-ID: <uveheu$34hm7$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> <uvanua$27qn8$1@dont-email.me>
<uvbbed$2cdhc$1@dont-email.me> <uvbhph$2do64$1@dont-email.me>
<uveeo1$33v1t$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 13 Apr 2024 20:04:15 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d4ef3b0d8d9a541a779812558697c529";
logging-data="3294919"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+3BGQ6dDCwI4RZ3B04eI9LqtfY8O4i44k="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ea0oZLcmLxrK5iu/QM1QCzdfV70=
In-Reply-To: <uveeo1$33v1t$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Sat, 13 Apr 2024 18:04 UTC

On 13/04/2024 19:17, Janis Papanagnou wrote:
> On 12.04.2024 16:51, David Brown wrote:
>> On 12/04/2024 15:03, Janis Papanagnou wrote:
>>>
>>> Another one is that you can write (e.g. in Algol 68 or many other
>>> higher level languages) the equivalent of - again a simple example -
>>>
>>> int x = 2 * pi * r
>>>
>>> without necessity to know whether pi is a constant, the result of a
>>> function (calculation), the result of a function implicitly called
>>> just once on demand, or whatever else. Conceptually as a programming
>>> language user you want the value.
>>>
>>
>> But is that a good thing?
>
> In my book it is a good thing (but I wouldn't overestimate it)...
>
>> For some programming, especially with
>> higher-level languages, then it is fine. For other types of
>> programming, you want to know if functions are called in order to have a
>> better idea of the flow of control and the efficiency of the code, plus
>> perhaps thread safety.
>
> ...because the (in practice valid!) topics you mention _should_ not
> be of concern to the programmer. The "idea of the flow" should, IMO,
> certainly not depend on parenthesis. I'll try an example from a C++
> context... - Say, I want to get the "length" of a container. What I
> indeed care about is the complexity of that operation, but that
> should be part of the library specification. C++/STL provides me
> with O(1), O(N), O(x) information that I can count on. Though the
> procedure to determine some length() might depend on the type of
> the container; it may be just an attribute access, it might be a
> difference computation (last-first+1), or it might be an iteration.
> Despite that could be hidden in a function length() you need the
> O(x) information to be sure about efficiency. (Or to look into the
> function's source code of the function, if available, to analyze
> the algorithm.)
>

For most C++ programming, if you read code :

int len = xs.length;

you'll assume that is O(1). But if you read :

int len = xs.length();

you won't make that assumption. If you need to know the complexity,
you'll check exactly what type of container "xs" is, and look up the
complexity guarantees. (And while I showed a way to make calls in C++
without parentheses, I am not suggesting it's a good idea to invalidate
the assumptions readers will typically make about code.)

Again, this stuff is often not important, or at least not critical - but
sometimes it is.

> What I'm basically trying to say is that length() doesn't provide
> the certainty or information that one needs or likes to have. All
> it provides is a syntactical, technical detail of the language.
> With it you get the uncertainty of "Uh-oh, there's parentheses;
> now does it mean that it's expensive to use it?" - But you don't
> get relevant information from the parentheses!
>

Agreed. But it will often lead to assumptions.

However, those assumptions are based on the language. People who are
used to Pascal or Ada would have other assumptions (or lack of
assumptions) when reading Pascal or Ada.

> For the [general, non-C] programmer it's (IMO) clearer to not put
> (unnecessary) syntactical burden on him. He wants a value 'len'?
> He just gets the value 'len' (and not len())!
>
> I think I've already said that it's to a large degree probably
> personal experience and preferences whether one comes to the
> conclusion that it's a good thing, a bad thing, or even "mostly
> harmless" (meaningless).
>
> (These are the thoughts from someone who did not start his CS life
> with C-like languages. From someone who has seen a lot of languages
> with good concepts that needed decades to only slowly - if at all -
> find their way into the modern, mainstream, or hyped languages. I
> thought that evolution in programming languages would benefit from
> good concepts. But "Not Invented Here" principle seems to dominate.
> <end-of-rant>)

I started with BASIC (a half dozen varieties), then assembly and machine
code on multiple systems, brief flirtations with Logo, Forth, and even
Prolog and APL (/very/ briefly for these), then Pascal, then university
with Orwell (very similar to Haskell), Modula 2, C, Occam, then real
life with Pascal, assembly (many types), C, C++, Python, some hardware
design languages, and bits and pieces of a number of other languages for
fun or profit. It's nice to have a variety of experiences, even if the
great majority of work is in only a few of these languages.

>
>>
>> Just for fun, this is a way to let you define a function-like object
>> "pi" in C++ that is called automatically, without parentheses :
>> [...]
>> I am not giving an opinion as to whether or not this is a good idea (and
>> obviously it is completely redundant in the case of a compile-time
>> constant). Some people might think C++ is great because it lets you use
>> tricks like this, some people might think C++ is terrible because it
>> lets you use tricks like this :-)
>
> (Nice example.) - Well, to me C++ is (or was) great because it
> supported what I've learned to love from using Simula; classes
> and inheritance, the whole OO paradigm, "living objects" and a
> lot more that's still "undiscovered" by other languages. What I
> found terrible was that it inherited the whole uncertainty from
> using a low level language like C.
>

A lot of C++'s poorer parts are due to compatibility with C.
Compatibility with C is of course useful in many ways too, but it has
always been a millstone around C++'s neck.

Re: Recursion, Yo

<878r1grgn3.fsf@bsb.me.uk>

  copy mid

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

  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: Sun, 14 Apr 2024 00:23:44 +0100
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <878r1grgn3.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>
<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> <uvao71$27qit$1@dont-email.me>
<uvb9r4$2c31v$1@dont-email.me> <uvcing$2kbfj$6@dont-email.me>
<20240413203303.000001f9@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sun, 14 Apr 2024 01:23:49 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="630246efbb215cbe93f34fc90f0492a3";
logging-data="3424598"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19oRfxfUU2Tf1A8XD+BDg5ooRThGzCkm1g="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:FyN6+F59Cr5mO7e/yZv0av6jBrY=
sha1:0nUPvesO4QI3Jh7txHLPt7X5n2M=
X-BSB-Auth: 1.46d965c1f573fdbebcb5.20240414002344BST.878r1grgn3.fsf@bsb.me.uk
 by: Ben Bacarisse - Sat, 13 Apr 2024 23:23 UTC

Michael S <already5chosen@yahoo.com> writes:

> On Sat, 13 Apr 2024 00:13:36 -0000 (UTC)
> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>
>> On Fri, 12 Apr 2024 14:35:47 +0200, Janis Papanagnou wrote:
>>
>> > It seems that's one of the fundamental differences between
>> > (low-level) languages that want to provide such technical factors
>> > explicit to the user and between languages that want to provide a
>> > higher abstraction.
>> >
>> > Algol 60, Pascal, Simula 67 and Algol 60, Eiffel, etc. all took that
>> > approach.
>>
>> Pascal had explicit pointers, though. Algol 68 and Ada did not.
>
> Of course, Ada has pointers. The are called access types.
> https://en.wikibooks.org/wiki/Ada_Programming/Types/access
>
> I never learned Algol-68, but considering your reputation I'd want to
> see confirmation from more reliable source.

I suppose it all depends on what constitutes a pointer, but Algol 68 has
pointers to this extent:

BEGIN
INT i := 42;
[3] INT a := (1, 2, 3);

REF INT p := i; CO p is a "pointer" to i CO
REF INT(p) := 99; CO changes i via p CO
p := a[2]; CO p now points to the second element of array a CO
REF INT(p) := 99; CO change that element via p CO

print((i, a[1], a[2], a[3]))
END

I'd call p a pointer.

--
Ben.

Re: Recursion, Yo

<uvf7vs$3911c$3@dont-email.me>

  copy mid

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

  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: Sun, 14 Apr 2024 00:28:44 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <uvf7vs$3911c$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>
<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> <uvao71$27qit$1@dont-email.me>
<uvb9r4$2c31v$1@dont-email.me> <uvcing$2kbfj$6@dont-email.me>
<uveft2$346sv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 14 Apr 2024 02:28:44 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a18cb00ff50dc9a275e4b0d38d5de488";
logging-data="3441708"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pOXL/PoQ9UBj6IRvXjyT2"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:dnUU4gSOMHDfJoXcvJhvWYt0zH0=
 by: Lawrence D'Oliv - Sun, 14 Apr 2024 00:28 UTC

On Sat, 13 Apr 2024 19:37:37 +0200, Janis Papanagnou wrote:

> Pascal has pointers bound to the object (as opposed to C pointers).

Nothing fundamentally different. C pointers (at least as of ANSI C) are
just as typesafe as Pascal ones. Don’t understand what you mean about
“bound to the object”.

> But maybe you can explain where or how there's something "thrown away".

This is a valid Algol 68 program (just tested with a68g):

BEGIN PROC f = REAL : 3.1415; f END

It calls f, which returns a real, which is then cast to VOID -- i.e.
thrown away.

Re: Recursion, Yo

<20240414032902.00003dc8@yahoo.com>

  copy mid

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

  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: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Sun, 14 Apr 2024 03:29:02 +0300
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <20240414032902.00003dc8@yahoo.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>
<uvah1j$26gtr$1@dont-email.me>
<uvao71$27qit$1@dont-email.me>
<uvb9r4$2c31v$1@dont-email.me>
<uvcing$2kbfj$6@dont-email.me>
<20240413203303.000001f9@yahoo.com>
<878r1grgn3.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 14 Apr 2024 02:29:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a6eda57a0577a42a249c8ba4bc57435a";
logging-data="3444724"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18H74EMA3F+YCH2z3LgC0l9dbeiY5kfUqE="
Cancel-Lock: sha1:KKVwc9wSLIxvJjhU8qa7Oh610Jk=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
 by: Michael S - Sun, 14 Apr 2024 00:29 UTC

On Sun, 14 Apr 2024 00:23:44 +0100
Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:

> Michael S <already5chosen@yahoo.com> writes:
>
> > On Sat, 13 Apr 2024 00:13:36 -0000 (UTC)
> > Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> >
> >> On Fri, 12 Apr 2024 14:35:47 +0200, Janis Papanagnou wrote:
> >>
> >> > It seems that's one of the fundamental differences between
> >> > (low-level) languages that want to provide such technical factors
> >> > explicit to the user and between languages that want to provide a
> >> > higher abstraction.
> >> >
> >> > Algol 60, Pascal, Simula 67 and Algol 60, Eiffel, etc. all took
> >> > that approach.
> >>
> >> Pascal had explicit pointers, though. Algol 68 and Ada did not.
> >
> > Of course, Ada has pointers. The are called access types.
> > https://en.wikibooks.org/wiki/Ada_Programming/Types/access
> >
> > I never learned Algol-68, but considering your reputation I'd want
> > to see confirmation from more reliable source.
>
> I suppose it all depends on what constitutes a pointer, but Algol 68
> has pointers to this extent:
>
> BEGIN
> INT i := 42;
> [3] INT a := (1, 2, 3);
>
> REF INT p := i; CO p is a "pointer" to i
> CO REF INT(p) := 99; CO changes i via p
> CO p := a[2]; CO p now points to the second element of array a
> CO REF INT(p) := 99; CO change that element via p
> CO
>
> print((i, a[1], a[2], a[3]))
> END
>
> I'd call p a pointer.
>

Thank you.
It looks closer to C than to Pascal, i.e. pointer can point to any
object rather than just to dynamically allocated object.

Re: Recursion, Yo

<uvf80r$3911c$4@dont-email.me>

  copy mid

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

  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: Sun, 14 Apr 2024 00:29:16 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <uvf80r$3911c$4@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> <uvao71$27qit$1@dont-email.me>
<uvb9r4$2c31v$1@dont-email.me> <uvcing$2kbfj$6@dont-email.me>
<20240413203303.000001f9@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 14 Apr 2024 02:29:16 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a18cb00ff50dc9a275e4b0d38d5de488";
logging-data="3441708"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tz4ETJ7VL5IG5LU3zxlXu"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:lIY9Thma9Q1MZCSCUWQpLorENlg=
 by: Lawrence D'Oliv - Sun, 14 Apr 2024 00:29 UTC

On Sat, 13 Apr 2024 20:33:03 +0300, Michael S wrote:

> On Sat, 13 Apr 2024 00:13:36 -0000 (UTC)
> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>
>> Pascal had explicit pointers, though. Algol 68 and Ada did not.
>>
> Of course, Ada has pointers.

That’s why I said “explicit”.

Re: Recursion, Yo

<874jc4fxu6.fsf@nosuchdomain.example.com>

  copy mid

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

  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: Sat, 13 Apr 2024 20:05:21 -0700
Organization: None to speak of
Lines: 18
Message-ID: <874jc4fxu6.fsf@nosuchdomain.example.com>
References: <uut24f$2icpb$1@dont-email.me> <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>
<uvao71$27qit$1@dont-email.me> <uvb9r4$2c31v$1@dont-email.me>
<uvcing$2kbfj$6@dont-email.me> <20240413203303.000001f9@yahoo.com>
<uvf80r$3911c$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 14 Apr 2024 05:05:22 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="2411dcbbdbd044b2b7b33ffd9fab4444";
logging-data="3621783"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18sgTyjFY+Y3sIsvr6AONpr"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:H4VjKtSPO+kj0G5IIUPK86Pkw4s=
sha1:/bTJUO7EkucyymN8Cztf+CgEDt4=
 by: Keith Thompson - Sun, 14 Apr 2024 03:05 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> On Sat, 13 Apr 2024 20:33:03 +0300, Michael S wrote:
>
>> On Sat, 13 Apr 2024 00:13:36 -0000 (UTC)
>> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>>
>>> Pascal had explicit pointers, though. Algol 68 and Ada did not.
>>>
>> Of course, Ada has pointers.
>
> That’s why I said “explicit”.

How is "*" (C) more explicit than "access" (Ada)?

--
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

<8734roqmdb.fsf@bsb.me.uk>

  copy mid

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

  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: Sun, 14 Apr 2024 11:17:36 +0100
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <8734roqmdb.fsf@bsb.me.uk>
References: <uut24f$2icpb$1@dont-email.me> <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>
<uvao71$27qit$1@dont-email.me> <uvb9r4$2c31v$1@dont-email.me>
<uvcing$2kbfj$6@dont-email.me> <uveft2$346sv$1@dont-email.me>
<uvf7vs$3911c$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sun, 14 Apr 2024 12:17:37 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="630246efbb215cbe93f34fc90f0492a3";
logging-data="3765709"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/5AzQRNaNbNhy797jBelqXnVlSDQnqmvQ="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:HGpMJfqqMPovW9GqzGCWjkI1wuE=
sha1:OOcE0pG8Ldu5UDt+4H+NgeXDqSk=
X-BSB-Auth: 1.e80a0c55be249d49a9ac.20240414111736BST.8734roqmdb.fsf@bsb.me.uk
 by: Ben Bacarisse - Sun, 14 Apr 2024 10:17 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:

> On Sat, 13 Apr 2024 19:37:37 +0200, Janis Papanagnou wrote:
....
>> But maybe you can explain where or how there's something "thrown away".
>
> This is a valid Algol 68 program (just tested with a68g):
>
> BEGIN PROC f = REAL : 3.1415; f END
>
> It calls f, which returns a real, which is then cast to VOID -- i.e.
> thrown away.

You are just arguing about how you want to use an informal term: namely
to "throw away". In Algol 68, the mode (AKA type) "void" is,
conceptually, a collection of values like any other. The coercion
called voiding converts a value of some other type to the single value
of type void. You could describe this a "throwing away the value", or
you could agree with Janis and say that the serial-clause you wrote
yields the sole value of type void.

--
Ben.

Re: Recursion, Yo

<uvgjfr$3l055$1@dont-email.me>

  copy mid

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

  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: bc...@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Sun, 14 Apr 2024 13:51:06 +0100
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <uvgjfr$3l055$1@dont-email.me>
References: <uut24f$2icpb$1@dont-email.me> <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>
<uvao71$27qit$1@dont-email.me> <uvb9r4$2c31v$1@dont-email.me>
<uvcing$2kbfj$6@dont-email.me> <uveft2$346sv$1@dont-email.me>
<uvf7vs$3911c$3@dont-email.me> <8734roqmdb.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 14 Apr 2024 14:51:07 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="2e5d7d04faaf77b7b662b8d63f9f3b43";
logging-data="3834021"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19AlSLl1f6TmAOWyUivVYqe"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:fa3p5z2XeNHKUBRRyiW+mJNmgwM=
In-Reply-To: <8734roqmdb.fsf@bsb.me.uk>
Content-Language: en-GB
 by: bart - Sun, 14 Apr 2024 12:51 UTC

On 14/04/2024 11:17, Ben Bacarisse wrote:
> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>> On Sat, 13 Apr 2024 19:37:37 +0200, Janis Papanagnou wrote:
> ...
>>> But maybe you can explain where or how there's something "thrown away".
>>
>> This is a valid Algol 68 program (just tested with a68g):
>>
>> BEGIN PROC f = REAL : 3.1415; f END
>>
>> It calls f, which returns a real, which is then cast to VOID -- i.e.
>> thrown away.
>
> You are just arguing about how you want to use an informal term: namely
> to "throw away". In Algol 68, the mode (AKA type) "void" is,
> conceptually, a collection of values like any other. The coercion
> called voiding converts a value of some other type to the single value
> of type void. You could describe this a "throwing away the value", or
> you could agree with Janis and say that the serial-clause you wrote
> yields the sole value of type void.

It looks to me as though it yields a type REAL, as would this:

BEGIN 1.23 END

If the context has no need for such a type, then it is discarded
(although my own language would report an error for constructs like this
that make no sense by themselves; most likely it is an actual mistake).

But in one like this:

REAL x := BEGIN 1.23 END

Then that REAL value would be utilised.

Maybe you mean that in the first case, that REAL value is coerced to
VOID, and that process is what causes it to be discarded. To me that
sounds unwieldy.

Re: Recursion, Yo

<uvh7jp$13uej$1@i2pn2.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!.POSTED!not-for-mail
From: fir...@grunge.pl (fir)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Sun, 14 Apr 2024 20:34:28 +0200
Organization: i2pn2 (i2pn.org)
Message-ID: <uvh7jp$13uej$1@i2pn2.org>
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>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 14 Apr 2024 18:34:33 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="1178067"; mail-complaints-to="usenet@i2pn2.org";
posting-account="+ydHcGjgSeBt3Wz3WTfKefUptpAWaXduqfw5xdfsuS0";
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
In-Reply-To: <uv61f6$v1jm$1@dont-email.me>
X-Spam-Checker-Version: SpamAssassin 4.0.0
 by: fir - Sun, 14 Apr 2024 18:34 UTC

bart wrote:
>
> That's not an interesting use of a local function! You can move square()
> outside, and it would still work, putting aside any clashes with
> existing names called 'square'.
>
> The challenges of local functions are to do with accessing transient
> variables belonging to their enclosing function. Especially when a
> reference to the local function is called from outside the lexical scope
> of the enclosing function, with extra difficulties when the enclosing
> function is no longer active.
>

very good point

Re: Recursion, Yo

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

  copy mid

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

  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: Sun, 14 Apr 2024 22:47:26 +0100
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <87wmozpqfl.fsf@bsb.me.uk>
References: <uut24f$2icpb$1@dont-email.me> <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>
<uvao71$27qit$1@dont-email.me> <uvb9r4$2c31v$1@dont-email.me>
<uvcing$2kbfj$6@dont-email.me> <uveft2$346sv$1@dont-email.me>
<uvf7vs$3911c$3@dont-email.me> <8734roqmdb.fsf@bsb.me.uk>
<uvgjfr$3l055$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sun, 14 Apr 2024 23:47:26 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="630246efbb215cbe93f34fc90f0492a3";
logging-data="4047830"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NyKQ5VUbbFOgwEo4dGH2VHQUdOv9fKCU="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:35/nvydDJdmff7Qv4YrLqCdRUwA=
sha1:jiH+BgaCl4OBuQJ57VsnsRAdoo8=
X-BSB-Auth: 1.f7e547da0bc0669ef2e8.20240414224726BST.87wmozpqfl.fsf@bsb.me.uk
 by: Ben Bacarisse - Sun, 14 Apr 2024 21:47 UTC

bart <bc@freeuk.com> writes:

> On 14/04/2024 11:17, Ben Bacarisse wrote:
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>
>>> On Sat, 13 Apr 2024 19:37:37 +0200, Janis Papanagnou wrote:
>> ...
>>>> But maybe you can explain where or how there's something "thrown away".
>>>
>>> This is a valid Algol 68 program (just tested with a68g):
>>>
>>> BEGIN PROC f = REAL : 3.1415; f END
>>>
>>> It calls f, which returns a real, which is then cast to VOID -- i.e.
>>> thrown away.
>> You are just arguing about how you want to use an informal term: namely
>> to "throw away". In Algol 68, the mode (AKA type) "void" is,
>> conceptually, a collection of values like any other. The coercion
>> called voiding converts a value of some other type to the single value
>> of type void. You could describe this a "throwing away the value", or
>> you could agree with Janis and say that the serial-clause you wrote
>> yields the sole value of type void.
>
> It looks to me as though it yields a type REAL, as would this:
>
> BEGIN 1.23 END
>
> If the context has no need for such a type, then it is discarded (although
> my own language would report an error for constructs like this that make no
> sense by themselves; most likely it is an actual mistake).
>
> But in one like this:
>
> REAL x := BEGIN 1.23 END
>
> Then that REAL value would be utilised.

But what post posted was a whole program. The context -- it being the
top-level serial clause matters. I think. I say I think because I'd
like to find the wording that makes this so. a68g says it, but a68g is
an implementation and not the final word.

--
Ben.


devel / comp.lang.c / Re: Recursion, Yo

Pages:12345
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor