Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Unix will self-destruct in five seconds... 4... 3... 2... 1...


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

<uvhm89$3s6na$2@dont-email.me>

  copy mid

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

  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 22:44:25 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <uvhm89$3s6na$2@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
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 15 Apr 2024 00:44:25 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="5c7a3603e3efc53c60354bebe6f5dc5d";
logging-data="4070122"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+QLnjYWq/7a1ejJ6mJQOUS"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:KYu4ClInjY88nhQw8PNJ8x46/aY=
 by: Lawrence D'Oliv - Sun, 14 Apr 2024 22:44 UTC

On Sun, 14 Apr 2024 11:17:36 +0100, Ben Bacarisse wrote:

> In Algol 68, the mode (AKA type) "void" is,
> conceptually, a collection of values like any other.

It has only a single value, EMPTY. Therefore, the number of bits required
to store a VOID value is ... zero.

That’s what “throwing away” means.

Re: Recursion, Yo

<uvi79d$2ubl$1@dont-email.me>

  copy mid

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

  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: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Sun, 14 Apr 2024 20:35:09 -0700
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <uvi79d$2ubl$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>
<uvhm89$3s6na$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 15 Apr 2024 05:35:10 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7d60a1f57502b9704c1d77fb39f6ec8f";
logging-data="96629"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18cRpPxB1KXFHfEOlb+YDGqungdFB2v/rs="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:JuIC3MwpiSIFRMnLUONPlAzPbx8=
In-Reply-To: <uvhm89$3s6na$2@dont-email.me>
Content-Language: en-US
 by: Chris M. Thomasson - Mon, 15 Apr 2024 03:35 UTC

On 4/14/2024 3:44 PM, Lawrence D'Oliveiro wrote:
> On Sun, 14 Apr 2024 11:17:36 +0100, Ben Bacarisse wrote:
>
>> In Algol 68, the mode (AKA type) "void" is,
>> conceptually, a collection of values like any other.
>
> It has only a single value, EMPTY. Therefore, the number of bits required
> to store a VOID value is ... zero.

How to denote EMPTY?

n0 := EMPTY
n1 := EMPTY
n2 := EMPTY

So, this takes zero bits to store? I must be missing something here. Sorry.

>
> That’s what “throwing away” means.

Re: Recursion, Yo

<uvj8qp$9s2q$1@dont-email.me>

  copy mid

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

  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: Mon, 15 Apr 2024 15:07:37 +0200
Organization: A noiseless patient Spider
Lines: 82
Message-ID: <uvj8qp$9s2q$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>
<20240413203303.000001f9@yahoo.com> <878r1grgn3.fsf@bsb.me.uk>
<20240414032902.00003dc8@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 15 Apr 2024 15:07:38 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7442213264ab8592460c4ec71b7997a1";
logging-data="323674"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18JU6TawT2h6fyQjzG0pSDp"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:cv+By0BvO0Ch2s18fRbU4jX1XBo=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <20240414032902.00003dc8@yahoo.com>
 by: Janis Papanagnou - Mon, 15 Apr 2024 13:07 UTC

On 14.04.2024 02:29, Michael S wrote:
> 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.

The major difference is that they are closely bound to the type.
In that respect they are more like Pascal pointers. C pointers
open the can of issues with arithmetic on pointer values. You
don't find that in Pascal or Algol 68. WRT 'REF' you have to
understand that it's a sort of "technical" reference item that
is used to link structures as pointers do. And besides that you
also have allocators for stack or heap objects. You combine the
two to get what you have in other languages. Usually you don't
see the stack allocator because Algol 68 allows abbreviations
to write only brief declarations what we also know from other
programming languages. For example the following are the same

INT a := 42;

REF INT a = LOC INT := 42;

It says that a is an integer 'REF' ("lvalue"), identical to a
local (stack) item - where LOC is the generator -, and finally
the value assigned.

You can replace the 'LOC' by 'HEAP' if you want the heap generator
to allocate the memory. For example

HEAP INT a;

REF INT a = HEAP INT;

In Algol 68 (as in Pascal) these references are bound to the type
(in the above examples to 'INT').

Janis

Re: Recursion, Yo

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

  copy mid

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

  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: Mon, 15 Apr 2024 08:46:17 -0700
Organization: None to speak of
Lines: 63
Message-ID: <87frvmsk6u.fsf@nosuchdomain.example.com>
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> <20240413203303.000001f9@yahoo.com>
<878r1grgn3.fsf@bsb.me.uk> <20240414032902.00003dc8@yahoo.com>
<uvj8qp$9s2q$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Mon, 15 Apr 2024 17:46:21 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="73a59417e165fb25aa14cac8ac742e2a";
logging-data="394903"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+T7lh9+eLbrjXVI83GLQwT"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:T84CEZny76J4m2fRpYTpIzIGJGY=
sha1:lrhoiuqf7x7ZJvFihjFtiTPgrf0=
 by: Keith Thompson - Mon, 15 Apr 2024 15:46 UTC

Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
> On 14.04.2024 02:29, Michael S wrote:
>> 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.
>
> The major difference is that they are closely bound to the type.
> In that respect they are more like Pascal pointers. C pointers
> open the can of issues with arithmetic on pointer values. You
> don't find that in Pascal or Algol 68.
[...]

How are C pointers not "closely bound to the type"?

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

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

  copy mid

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

  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: Mon, 15 Apr 2024 17:47:35 +0100
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <87jzkypo7s.fsf@bsb.me.uk>
References: <uut24f$2icpb$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>
<20240414032902.00003dc8@yahoo.com> <uvj8qp$9s2q$1@dont-email.me>
<87frvmsk6u.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Mon, 15 Apr 2024 18:47:37 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="6f2b9767d6d5a3e2221fc1fe8acd049e";
logging-data="423285"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ISeJanoAsZhfK922OcmXjM0/nRs7dovM="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:jfoObZCOy8gDEUWIQN4ZnRXOYzQ=
sha1:DrDoXy3b9ZQWdLY7EBwS7xKaA+M=
X-BSB-Auth: 1.0f8246404aead26c9873.20240415174735BST.87jzkypo7s.fsf@bsb.me.uk
 by: Ben Bacarisse - Mon, 15 Apr 2024 16:47 UTC

Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>> On 14.04.2024 02:29, Michael S wrote:
<Algol 68 code elided>
>>> It looks closer to C than to Pascal, i.e. pointer can point to any
>>> object rather than just to dynamically allocated object.
>>
>> The major difference is that they are closely bound to the type.
>> In that respect they are more like Pascal pointers. C pointers
>> open the can of issues with arithmetic on pointer values. You
>> don't find that in Pascal or Algol 68.
> [...]
>
> How are C pointers not "closely bound to the type"?

int i = 42;
memcpy(&i, &(float){3.14}, sizeof i);
printf("%d\n", i);

That looks like a pretty loose association between pointer and object
type to me. This is not an accident or an unintended loophole. It's by
design.

Certainly every pointer value in C has an associated type, but the
intention is that this association can be changed by pointer type
conversion as needed.

You often /have/ to make us of this. For example, when calling qsort,
you will usually change the association between the pointer and the
pointed-to type (void) in order to do the comparison. And C does not
even insist that you change it back to the original pointed-to type as
you can legally write a comparison function for, say, float data that
uses the representation as "raw" bytes.

--
Ben.

Re: Recursion, Yo

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

  copy mid

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

  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: Mon, 15 Apr 2024 17:50:03 +0100
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <87edb6po3o.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>
<uvhm89$3s6na$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 15 Apr 2024 18:50:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="6f2b9767d6d5a3e2221fc1fe8acd049e";
logging-data="423285"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+YSW3VC6Ftr4keCnvVHhQt/osNM6QQpo0="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:y4hq8DGLIMkL883ZynBUFgqJ/94=
sha1:dJLRDVkhus3xD4xWwVi6Wij48U0=
X-BSB-Auth: 1.75f46dba2ba3b6dc11aa.20240415175003BST.87edb6po3o.fsf@bsb.me.uk
 by: Ben Bacarisse - Mon, 15 Apr 2024 16:50 UTC

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

> On Sun, 14 Apr 2024 11:17:36 +0100, Ben Bacarisse wrote:
>
>> In Algol 68, the mode (AKA type) "void" is,
>> conceptually, a collection of values like any other.
>
> It has only a single value, EMPTY. Therefore, the number of bits required
> to store a VOID value is ... zero.
>
> That’s what “throwing away” means.

I did not have any trouble understanding what you meant by "throwing
away". I was simply pointing out that there is another way to look at
the voiding coercion that is entirely consistent with what Janis had
said.

--
Ben.

Re: Recursion, Yo

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

  copy mid

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

  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: Mon, 15 Apr 2024 17:50:45 +0100
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <878r1epo2i.fsf@bsb.me.uk>
References: <uut24f$2icpb$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> <uvhm89$3s6na$2@dont-email.me>
<uvi79d$2ubl$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Mon, 15 Apr 2024 18:50:46 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="6f2b9767d6d5a3e2221fc1fe8acd049e";
logging-data="423285"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18a0kv4KDWQ6XeSPn05I914rERqYKQQVqY="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:lBuuZVt4eFTfIzCsAdOlwVAvyQ4=
sha1:xMxPshVGmlJf/wqiayispN236hk=
X-BSB-Auth: 1.2f68d674e7b1fcbfee31.20240415175045BST.878r1epo2i.fsf@bsb.me.uk
 by: Ben Bacarisse - Mon, 15 Apr 2024 16:50 UTC

"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:

> On 4/14/2024 3:44 PM, Lawrence D'Oliveiro wrote:
>> On Sun, 14 Apr 2024 11:17:36 +0100, Ben Bacarisse wrote:
>>
>>> In Algol 68, the mode (AKA type) "void" is,
>>> conceptually, a collection of values like any other.
>> It has only a single value, EMPTY. Therefore, the number of bits required
>> to store a VOID value is ... zero.
>
> How to denote EMPTY?

Algol 68 has no denotation for the empty value.

--
Ben.

Re: Recursion, Yo

<uvjs4c$ebsr$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!newsfeed.bofh.team!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: Mon, 15 Apr 2024 20:36:58 +0200
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <uvjs4c$ebsr$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>
<uvhm89$3s6na$2@dont-email.me> <uvi79d$2ubl$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 15 Apr 2024 20:37:00 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0881d93770e909c422c4476978404946";
logging-data="470939"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+cG/whFLi1uGW/g8N+7v6I"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:N+ZB5UEIHyUJoB7bE1Q4fm+8HCw=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <uvi79d$2ubl$1@dont-email.me>
 by: Janis Papanagnou - Mon, 15 Apr 2024 18:36 UTC

On 15.04.2024 05:35, Chris M. Thomasson wrote:
> On 4/14/2024 3:44 PM, Lawrence D'Oliveiro wrote:
>> On Sun, 14 Apr 2024 11:17:36 +0100, Ben Bacarisse wrote:
>>
>>> In Algol 68, the mode (AKA type) "void" is,
>>> conceptually, a collection of values like any other.
>>
>> It has only a single value, EMPTY. Therefore, the number of bits required
>> to store a VOID value is ... zero.
>
> How to denote EMPTY?
>
> n0 := EMPTY
> n1 := EMPTY
> n2 := EMPTY
>
> So, this takes zero bits to store? I must be missing something here. Sorry.

I suppose it's just the way how one looks onto it. If I program in
"C" I always seem to have some bits and bytes in mind, as opposed
to Algol 68 where I seem to be thinking more abstract (high-level).

I usually don't think about whether there's a -1, 0, 42, value used
to represent 'EMPTY' in memory. This may stem from the CS education
where I've learned not to assume a physical von Neumann architecture
with registers etc. to be a precondition for an implementation. Such
cases (while they likely are) need not be implemented using numbers
in a memory [in theory].

Other such values like 'EMPTY' are also known from other languages;
like the Algol 68 terms 'NIL' ('null', 'NULL', 'nil'), and 'SKIP'.

If any of these keywords will be internally represented by special
values (like 0 or -1) and special CPU commands (like 'NOP') is not
really important since you don't work with such low-level entities
(in cases there are such low-level entities in the first place).
If you use a 'NIL' you just test with 'ISNT NIL', for example.

Algol 68 and C are so different that mutual understanding might be
difficult depending on personal background, focus, and fantasy. :-)

Your question: "So, this takes zero bits to store?" - I can't tell.

We could look into the Algol 68 Genie compiler, but you wouldn't
get a general answer, just a very specific (useless) information.

Janis

Re: Recursion, Yo

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

  copy mid

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

  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: Mon, 15 Apr 2024 12:00:30 -0700
Organization: None to speak of
Lines: 50
Message-ID: <87bk6asb75.fsf@nosuchdomain.example.com>
References: <uut24f$2icpb$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> <20240414032902.00003dc8@yahoo.com>
<uvj8qp$9s2q$1@dont-email.me>
<87frvmsk6u.fsf@nosuchdomain.example.com> <87jzkypo7s.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Mon, 15 Apr 2024 21:00:44 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="73a59417e165fb25aa14cac8ac742e2a";
logging-data="478112"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HSAJqBCRReygnGVsBLEzx"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:P/x9TZV8TElbgHj2dR9TJs2w8T8=
sha1:P8LtUW2StKMBI5z06/5hwTHkQos=
 by: Keith Thompson - Mon, 15 Apr 2024 19:00 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>>> On 14.04.2024 02:29, Michael S wrote:
> <Algol 68 code elided>
>>>> It looks closer to C than to Pascal, i.e. pointer can point to any
>>>> object rather than just to dynamically allocated object.
>>>
>>> The major difference is that they are closely bound to the type.
>>> In that respect they are more like Pascal pointers. C pointers
>>> open the can of issues with arithmetic on pointer values. You
>>> don't find that in Pascal or Algol 68.
>> [...]
>>
>> How are C pointers not "closely bound to the type"?
>
> int i = 42;
> memcpy(&i, &(float){3.14}, sizeof i);
> printf("%d\n", i);
>
> That looks like a pretty loose association between pointer and object
> type to me. This is not an accident or an unintended loophole. It's by
> design.
>
> Certainly every pointer value in C has an associated type, but the
> intention is that this association can be changed by pointer type
> conversion as needed.
>
> You often /have/ to make us of this. For example, when calling qsort,
> you will usually change the association between the pointer and the
> pointed-to type (void) in order to do the comparison. And C does not
> even insist that you change it back to the original pointed-to type as
> you can legally write a comparison function for, say, float data that
> uses the representation as "raw" bytes.

OK. The way I'd describe it is that C (non-void) pointers *are*
"closely bound to the type", but in addition C provides operations,
particularly pointer casts and implicit conversions to and from void*,
that can override that binding.

Janis mentioned pointer arithmetic. I wouldn't say that overrides the
type binding; it merely provides a set of operations, that some other
languages lack, for constructing a pointer value from another pointer
value. I don't know whether Janis meant that to be an example of not
being closely bound to the type, or as a distinct statement.

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

<uvjusj$ev88$1@dont-email.me>

  copy mid

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

  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: Mon, 15 Apr 2024 20:24:02 +0100
Organization: A noiseless patient Spider
Lines: 72
Message-ID: <uvjusj$ev88$1@dont-email.me>
References: <uut24f$2icpb$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> <20240414032902.00003dc8@yahoo.com>
<uvj8qp$9s2q$1@dont-email.me> <87frvmsk6u.fsf@nosuchdomain.example.com>
<87jzkypo7s.fsf@bsb.me.uk> <87bk6asb75.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 15 Apr 2024 21:24:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d961aec3d560b43720f52a97032eeff3";
logging-data="490760"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18kx+/TjiX9rMZKi3Fu5AU3"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:dL2gSrkRimID22HBIMhztqWa5Ec=
Content-Language: en-GB
In-Reply-To: <87bk6asb75.fsf@nosuchdomain.example.com>
 by: bart - Mon, 15 Apr 2024 19:24 UTC

On 15/04/2024 20:00, Keith Thompson wrote:
> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>>>> On 14.04.2024 02:29, Michael S wrote:
>> <Algol 68 code elided>
>>>>> It looks closer to C than to Pascal, i.e. pointer can point to any
>>>>> object rather than just to dynamically allocated object.
>>>>
>>>> The major difference is that they are closely bound to the type.
>>>> In that respect they are more like Pascal pointers. C pointers
>>>> open the can of issues with arithmetic on pointer values. You
>>>> don't find that in Pascal or Algol 68.
>>> [...]
>>>
>>> How are C pointers not "closely bound to the type"?
>>
>> int i = 42;
>> memcpy(&i, &(float){3.14}, sizeof i);
>> printf("%d\n", i);
>>
>> That looks like a pretty loose association between pointer and object
>> type to me. This is not an accident or an unintended loophole. It's by
>> design.
>>
>> Certainly every pointer value in C has an associated type, but the
>> intention is that this association can be changed by pointer type
>> conversion as needed.
>>
>> You often /have/ to make us of this. For example, when calling qsort,
>> you will usually change the association between the pointer and the
>> pointed-to type (void) in order to do the comparison. And C does not
>> even insist that you change it back to the original pointed-to type as
>> you can legally write a comparison function for, say, float data that
>> uses the representation as "raw" bytes.
>
> OK. The way I'd describe it is that C (non-void) pointers *are*
> "closely bound to the type", but in addition C provides operations,
> particularly pointer casts and implicit conversions to and from void*,
> that can override that binding.
>
> Janis mentioned pointer arithmetic. I wouldn't say that overrides the
> type binding; it merely provides a set of operations, that some other
> languages lack, for constructing a pointer value from another pointer
> value. I don't know whether Janis meant that to be an example of not
> being closely bound to the type, or as a distinct statement.

Implicit in every C non-void object pointer, is that it points to an
element of an array, so that you access neighbouring elements via P+1,
P-2, ++P and so on.

That is the case whether or not P actually points within such a sequence.

That assumption appears to be missing from those other languages.

C itself doesn't seem that bothered; it just treats any isolated object
that a pointer refers to, as though it was part of an imaginary
1-element array.

Then any attempt to refer beyond it via pointer arithmetic, is a mere
bounds error. But it's a bit more serious than that. It's like treating
*NULL as a bounds error, because it might be a few MB away from the
nearest valid object.

(My own lower level language allows similar pointer arithmetic. But it
doesn't allow P[i] syntax; pointers and arrays are more distinct and
therefore safer.

With an older dynamic language, pointers had a length attribute
attached. So that (IIRC) single targets had a length of 1 so pointer
arithmetic was limited.)

Re: Recursion, Yo

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

  copy mid

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

  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: Mon, 15 Apr 2024 21:37:35 +0100
Organization: A noiseless patient Spider
Lines: 74
Message-ID: <87zftunz00.fsf@bsb.me.uk>
References: <uut24f$2icpb$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> <20240414032902.00003dc8@yahoo.com>
<uvj8qp$9s2q$1@dont-email.me>
<87frvmsk6u.fsf@nosuchdomain.example.com> <87jzkypo7s.fsf@bsb.me.uk>
<87bk6asb75.fsf@nosuchdomain.example.com>
<uvjusj$ev88$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Mon, 15 Apr 2024 22:37:35 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="6f2b9767d6d5a3e2221fc1fe8acd049e";
logging-data="514562"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+M8vHCKMT9wsHssDAxnpPKg3AZHIRxhhQ="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:oJnyXbAkGsE755KLI60sDhix0n4=
sha1:LwXdNLBrpppjB+RgZ3F2XDLlP+I=
X-BSB-Auth: 1.025398ef3d18478ef8ad.20240415213735BST.87zftunz00.fsf@bsb.me.uk
 by: Ben Bacarisse - Mon, 15 Apr 2024 20:37 UTC

bart <bc@freeuk.com> writes:

> On 15/04/2024 20:00, Keith Thompson wrote:
>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>>> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>>>>> On 14.04.2024 02:29, Michael S wrote:
>>> <Algol 68 code elided>
>>>>>> It looks closer to C than to Pascal, i.e. pointer can point to any
>>>>>> object rather than just to dynamically allocated object.
>>>>>
>>>>> The major difference is that they are closely bound to the type.
>>>>> In that respect they are more like Pascal pointers. C pointers
>>>>> open the can of issues with arithmetic on pointer values. You
>>>>> don't find that in Pascal or Algol 68.
>>>> [...]
>>>>
>>>> How are C pointers not "closely bound to the type"?
>>>
>>> int i = 42;
>>> memcpy(&i, &(float){3.14}, sizeof i);
>>> printf("%d\n", i);
>>>
>>> That looks like a pretty loose association between pointer and object
>>> type to me. This is not an accident or an unintended loophole. It's by
>>> design.
>>>
>>> Certainly every pointer value in C has an associated type, but the
>>> intention is that this association can be changed by pointer type
>>> conversion as needed.
>>>
>>> You often /have/ to make us of this. For example, when calling qsort,
>>> you will usually change the association between the pointer and the
>>> pointed-to type (void) in order to do the comparison. And C does not
>>> even insist that you change it back to the original pointed-to type as
>>> you can legally write a comparison function for, say, float data that
>>> uses the representation as "raw" bytes.
>> OK. The way I'd describe it is that C (non-void) pointers *are*
>> "closely bound to the type", but in addition C provides operations,
>> particularly pointer casts and implicit conversions to and from void*,
>> that can override that binding.
>> Janis mentioned pointer arithmetic. I wouldn't say that overrides the
>> type binding; it merely provides a set of operations, that some other
>> languages lack, for constructing a pointer value from another pointer
>> value. I don't know whether Janis meant that to be an example of not
>> being closely bound to the type, or as a distinct statement.
>
> Implicit in every C non-void object pointer, is that it points to an
> element of an array, so that you access neighbouring elements via P+1, P-2,
> ++P and so on.
>
> That is the case whether or not P actually points within such a
> sequence.

No that is not implicit in every non-void object pointer. In fact, it
is explicitly stated in the language standard that you /can't/ access
/anything/ via the "neighbouring" pointers except when the original is a
pointer into an array and those neighbouring elements are also in the
same array.

> That assumption appears to be missing from those other languages.

It's missing in C too. Address arithmetic and access is permitted only
within an array.

> C itself doesn't seem that bothered; it just treats any isolated object
> that a pointer refers to, as though it was part of an imaginary 1-element
> array.

This is true, and it's not implicit -- it is explicitly stated in the
language standard.

--
Ben.

Re: Recursion, Yo

<uvk3ab$fsvh$1@dont-email.me>

  copy mid

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

  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: Mon, 15 Apr 2024 22:39:37 +0200
Organization: A noiseless patient Spider
Lines: 85
Message-ID: <uvk3ab$fsvh$1@dont-email.me>
References: <uut24f$2icpb$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> <20240414032902.00003dc8@yahoo.com>
<uvj8qp$9s2q$1@dont-email.me> <87frvmsk6u.fsf@nosuchdomain.example.com>
<87jzkypo7s.fsf@bsb.me.uk> <87bk6asb75.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 15 Apr 2024 22:39:40 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0881d93770e909c422c4476978404946";
logging-data="521201"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/zMaIwK3d40UbPdrA+nwG1"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:fkoaEnf/R9NA2ophx5JHscQNmGo=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <87bk6asb75.fsf@nosuchdomain.example.com>
 by: Janis Papanagnou - Mon, 15 Apr 2024 20:39 UTC

On 15.04.2024 21:00, Keith Thompson wrote:
> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>>>> On 14.04.2024 02:29, Michael S wrote:
>> <Algol 68 code elided>
>>>>> It looks closer to C than to Pascal, i.e. pointer can point to any
>>>>> object rather than just to dynamically allocated object.
>>>>
>>>> The major difference is that they are closely bound to the type.
>>>> In that respect they are more like Pascal pointers. C pointers
>>>> open the can of issues with arithmetic on pointer values. You
>>>> don't find that in Pascal or Algol 68.
>>> [...]
>>>
>>> How are C pointers not "closely bound to the type"?
>>
>> int i = 42;
>> memcpy(&i, &(float){3.14}, sizeof i);
>> printf("%d\n", i);
>>
>> That looks like a pretty loose association between pointer and object
>> type to me. This is not an accident or an unintended loophole. It's by
>> design.
>>
>> Certainly every pointer value in C has an associated type, but the
>> intention is that this association can be changed by pointer type
>> conversion as needed.
>>
>> You often /have/ to make us of this. For example, when calling qsort,
>> you will usually change the association between the pointer and the
>> pointed-to type (void) in order to do the comparison. And C does not
>> even insist that you change it back to the original pointed-to type as
>> you can legally write a comparison function for, say, float data that
>> uses the representation as "raw" bytes.
>
> OK. The way I'd describe it is that C (non-void) pointers *are*
> "closely bound to the type", but in addition C provides operations,
> particularly pointer casts and implicit conversions to and from void*,
> that can override that binding.
>
> Janis mentioned pointer arithmetic. I wouldn't say that overrides the
> type binding; it merely provides a set of operations, that some other
> languages lack, for constructing a pointer value from another pointer
> value. I don't know whether Janis meant that to be an example of not
> being closely bound to the type, or as a distinct statement.

It's no "lacking operations". It's a deliberate design for safety.

Rutishauser spoke (for Algol 60) about "leaving the Can of Pandora
closed". And F. L. Bauer noted that "Pascal opened the Can of Pandora
but put a fly screen over it". (Pascal can here be seen as an example
of one language, other HLLs have done it basically the same way.)

The rest can probably be derived from inspecting how various HLL do
support that and how C does it. Basically,
- memory of appropriate size is allocated
- the reference is assigned to the variable
- access is done without address modification possible
You may consider that from a low level perspective a missing feature,
but I call it not unnecessarily opening a can of issues. - Examples...

Pascal: var p : ^T; new (p); p^.x := ... ;

Algol 68: REF T p = HEAP T; x OF p := ... ;

Simula 67: REF (T) p; p :- new T; p.x := ... ;

C: T * p = (T *) malloc (sizeof(T)); (p+42) = ... ;

Yes, you would not write that, but you can.
And all sorts of casts makes it even worse.
In the other languages mentioned you can't.

C++: with it's 'new' (and also 'malloc') is somewhat ambivalent.

(Disclaimers:
1. Code snippets may contain errors.
2. I don't know of newer C standards, just suppose that nothing
substantial has changed in this respect to fix the inherent
original C design criteria.)

Janis

Re: Recursion, Yo

<uvk46n$g3bh$1@dont-email.me>

  copy mid

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

  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: Mon, 15 Apr 2024 22:54:45 +0200
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <uvk46n$g3bh$1@dont-email.me>
References: <uut24f$2icpb$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> <20240414032902.00003dc8@yahoo.com>
<uvj8qp$9s2q$1@dont-email.me> <87frvmsk6u.fsf@nosuchdomain.example.com>
<87jzkypo7s.fsf@bsb.me.uk> <87bk6asb75.fsf@nosuchdomain.example.com>
<uvk3ab$fsvh$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 15 Apr 2024 22:54:47 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0881d93770e909c422c4476978404946";
logging-data="527729"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18WgSZmRaS5z63IO8k0LpqF"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:31Go+9TPRrDMWE8ZiqxL5Mwh5ZU=
In-Reply-To: <uvk3ab$fsvh$1@dont-email.me>
 by: Janis Papanagnou - Mon, 15 Apr 2024 20:54 UTC

On 15.04.2024 22:39, Janis Papanagnou wrote:
>
> C: T * p = (T *) malloc (sizeof(T)); (p+42) = ... ;
>
> (Disclaimers:
> 1. Code snippets may contain errors.

One error I made...

*(p+42) = ... ;

or
p[42] = ... ;

Janis

Re: Recursion, Yo

<877cgys4ib.fsf@nosuchdomain.example.com>

  copy mid

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

  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: Mon, 15 Apr 2024 14:25:00 -0700
Organization: None to speak of
Lines: 67
Message-ID: <877cgys4ib.fsf@nosuchdomain.example.com>
References: <uut24f$2icpb$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> <20240414032902.00003dc8@yahoo.com>
<uvj8qp$9s2q$1@dont-email.me>
<87frvmsk6u.fsf@nosuchdomain.example.com> <87jzkypo7s.fsf@bsb.me.uk>
<87bk6asb75.fsf@nosuchdomain.example.com>
<uvk3ab$fsvh$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Mon, 15 Apr 2024 23:25:01 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="73a59417e165fb25aa14cac8ac742e2a";
logging-data="535702"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Gj7J13hJTwNkXoj/0vjGn"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:VIPozOs9zFGbQvg1eeNfELKcO8Q=
sha1:snloncIzHiSZMMkLghpEvo38i34=
 by: Keith Thompson - Mon, 15 Apr 2024 21:25 UTC

Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
> On 15.04.2024 21:00, Keith Thompson wrote:
>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>>> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>>>>> On 14.04.2024 02:29, Michael S wrote:
>>> <Algol 68 code elided>
>>>>>> It looks closer to C than to Pascal, i.e. pointer can point to any
>>>>>> object rather than just to dynamically allocated object.
>>>>>
>>>>> The major difference is that they are closely bound to the type.
>>>>> In that respect they are more like Pascal pointers. C pointers
>>>>> open the can of issues with arithmetic on pointer values. You
>>>>> don't find that in Pascal or Algol 68.
>>>> [...]
>>>>
>>>> How are C pointers not "closely bound to the type"?
>>>
>>> int i = 42;
>>> memcpy(&i, &(float){3.14}, sizeof i);
>>> printf("%d\n", i);
>>>
>>> That looks like a pretty loose association between pointer and object
>>> type to me. This is not an accident or an unintended loophole. It's by
>>> design.
>>>
>>> Certainly every pointer value in C has an associated type, but the
>>> intention is that this association can be changed by pointer type
>>> conversion as needed.
>>>
>>> You often /have/ to make us of this. For example, when calling qsort,
>>> you will usually change the association between the pointer and the
>>> pointed-to type (void) in order to do the comparison. And C does not
>>> even insist that you change it back to the original pointed-to type as
>>> you can legally write a comparison function for, say, float data that
>>> uses the representation as "raw" bytes.
>>
>> OK. The way I'd describe it is that C (non-void) pointers *are*
>> "closely bound to the type", but in addition C provides operations,
>> particularly pointer casts and implicit conversions to and from void*,
>> that can override that binding.
>>
>> Janis mentioned pointer arithmetic. I wouldn't say that overrides the
>> type binding; it merely provides a set of operations, that some other
>> languages lack, for constructing a pointer value from another pointer
>> value. I don't know whether Janis meant that to be an example of not
>> being closely bound to the type, or as a distinct statement.
>
> It's no "lacking operations". It's a deliberate design for safety.

My use of the word "lack" wasn't meant as a value judgement.

Certainly C allows the association of a pointer with the type of the
object it points to be overridden. I'd still say (again) that C
non-void pointers are "closely bound to the type" -- closely, but not
irrevocably.

Many more type-strict languages permit similar overriding of that
association, perhaps with a more explicit syntax (see "unsafe" in Rust,
"Unchecked_Conversion" in 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

<uvk9po$h2pg$6@dont-email.me>

  copy mid

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

  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: Mon, 15 Apr 2024 22:30:16 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <uvk9po$h2pg$6@dont-email.me>
References: <uut24f$2icpb$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> <uvhm89$3s6na$2@dont-email.me>
<uvi79d$2ubl$1@dont-email.me> <878r1epo2i.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 16 Apr 2024 00:30:17 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7122d47f46672ef7a70e2ca241d20ff2";
logging-data="559920"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18yKNYyNWih7RsxkVM0kej6"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:UJdfAO386TQn4hQflEdBNpGanxo=
 by: Lawrence D'Oliv - Mon, 15 Apr 2024 22:30 UTC

On Mon, 15 Apr 2024 17:50:45 +0100, Ben Bacarisse wrote:

> Algol 68 has no denotation for the empty value.

Section 8.1.5.1 of the Revised Report:

void denotation : empty symbol.

Re: Recursion, Yo

<uvk9ud$h2pg$7@dont-email.me>

  copy mid

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

  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: Mon, 15 Apr 2024 22:32:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <uvk9ud$h2pg$7@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>
<uvhm89$3s6na$2@dont-email.me> <uvi79d$2ubl$1@dont-email.me>
<uvjs4c$ebsr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 16 Apr 2024 00:32:46 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7122d47f46672ef7a70e2ca241d20ff2";
logging-data="559920"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18F3g7w5+bzAht6Ft1umf3w"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:gV36GGt8OyFhtvzA3BrQxnWF8Ig=
 by: Lawrence D'Oliv - Mon, 15 Apr 2024 22:32 UTC

On Mon, 15 Apr 2024 20:36:58 +0200, Janis Papanagnou wrote:

> I usually don't think about whether there's a -1, 0, 42, value used to
> represent 'EMPTY' in memory. This may stem from the CS education where
> I've learned not to assume a physical von Neumann architecture with
> registers etc. ...

The concept of “bits” comes from information theory. It has nothing to do
with von Neumann or Paul Newman or Gary Oldman or anything else. If you
have zero information to convey, then the number of bits of information is
zero.

> Other such values like 'EMPTY' are also known from other languages; like
> the Algol 68 terms 'NIL' ('null', 'NULL', 'nil'), and 'SKIP'.

Those are all entirely different concepts in Algol 68.

Re: Recursion, Yo

<20240416231134.00004066@yahoo.com>

  copy mid

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

  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: Tue, 16 Apr 2024 23:11:34 +0300
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <20240416231134.00004066@yahoo.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>
<uveft2$346sv$1@dont-email.me>
<uvf7vs$3911c$3@dont-email.me>
<8734roqmdb.fsf@bsb.me.uk>
<uvhm89$3s6na$2@dont-email.me>
<uvi79d$2ubl$1@dont-email.me>
<uvjs4c$ebsr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 16 Apr 2024 22:11:41 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b6e7ddab6ceaee868731fda70ad0496e";
logging-data="1190292"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ja6D83DHVeXEgKoS5jM08RPV1jS+3Zdc="
Cancel-Lock: sha1:trYX3YobwVkZVR7m7xwY81vtVqw=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
 by: Michael S - Tue, 16 Apr 2024 20:11 UTC

On Mon, 15 Apr 2024 20:36:58 +0200
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
>
> Algol 68 and C are so different that mutual understanding might be
> difficult depending on personal background, focus, and fantasy. :-)
>

Interesting take.
I never learned Algol-68, but from pieces of info that I occasionally
got I was always thinking of it as rather similar to 'C'.
Both languages originated from common ancestor (Algol-60) and changed
it in similar directions, e.g. blurring the line between operators and
expression, making function pointers first class citizen, allowing
declaration of variables at block scope.
I think, in the past, when I remembered more about Algol-68, I had seen
more similarities.

Re: Recursion, Yo

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

  copy mid

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

  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: Wed, 17 Apr 2024 18:09:06 +0100
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <87edb3or0t.fsf@bsb.me.uk>
References: <uut24f$2icpb$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> <uvhm89$3s6na$2@dont-email.me>
<uvi79d$2ubl$1@dont-email.me> <878r1epo2i.fsf@bsb.me.uk>
<uvk9po$h2pg$6@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Wed, 17 Apr 2024 19:09:06 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="39e43a1f7f1a3f90c725b40bf55e0b25";
logging-data="1812256"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2lA8Tr0Srec3OYY66qHMveupmdhZmdso="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:yfz4QV4I9ZgiLspCjXSMGwWSaME=
sha1:ciYzX7PSAPbymeHzLnlBCk/7+ho=
X-BSB-Auth: 1.1b2b29d1c5ecdee5a43d.20240417180906BST.87edb3or0t.fsf@bsb.me.uk
 by: Ben Bacarisse - Wed, 17 Apr 2024 17:09 UTC

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

> On Mon, 15 Apr 2024 17:50:45 +0100, Ben Bacarisse wrote:
>
>> Algol 68 has no denotation for the empty value.
>
> Section 8.1.5.1 of the Revised Report:
>
> void denotation : empty symbol.

Thanks. If I had ever known that, I had forgotten. It's almost never
used because values are coerced to void all the contexts where it might
be otherwise required. I'm pretty sure I've never written it.

--
Ben.

Re: Recursion, Yo

<uvphg8$1qshp$6@dont-email.me>

  copy mid

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

  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: Wed, 17 Apr 2024 22:12:25 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <uvphg8$1qshp$6@dont-email.me>
References: <uut24f$2icpb$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> <uvhm89$3s6na$2@dont-email.me>
<uvi79d$2ubl$1@dont-email.me> <878r1epo2i.fsf@bsb.me.uk>
<uvk9po$h2pg$6@dont-email.me> <87edb3or0t.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 18 Apr 2024 00:12:25 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="ec6fcf3bb75b95711759fde7cd91a1dc";
logging-data="1929785"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19cAbjiDy91G+Csv1dJrsV9"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:GxTPWAUdaAmOf2TYSENCCS9mnZc=
 by: Lawrence D'Oliv - Wed, 17 Apr 2024 22:12 UTC

On Wed, 17 Apr 2024 18:09:06 +0100, Ben Bacarisse wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>> On Mon, 15 Apr 2024 17:50:45 +0100, Ben Bacarisse wrote:
>>
>>> Algol 68 has no denotation for the empty value.
>>
>> Section 8.1.5.1 of the Revised Report:
>>
>> void denotation : empty symbol.
>
> Thanks. If I had ever known that, I had forgotten. It's almost never
> used because values are coerced to void all the contexts where it might
> be otherwise required. I'm pretty sure I've never written it.

I also did a quick test in a68g that “BEGIN EMPTY END” is a valid program
(at least compiles without errors). But the last time I posted such a
thing, someone claimed that a68g was not necessarily a fully conforming
Algol 68 implementation ...

Re: Recursion, Yo

<86edb1xtjf.fsf@linuxsc.com>

  copy mid

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

  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: Fri, 19 Apr 2024 08:26:44 -0700
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <86edb1xtjf.fsf@linuxsc.com>
References: <uut24f$2icpb$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> <uvhm89$3s6na$2@dont-email.me> <uvi79d$2ubl$1@dont-email.me> <uvjs4c$ebsr$1@dont-email.me> <20240416231134.00004066@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Fri, 19 Apr 2024 17:26:46 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0518bb4613e9ed3dcecbcbf6c934dda9";
logging-data="3232813"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19XG+xxf2BjlTESBRHpPxFUw0QvmfA3eAM="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:hl1tI0x9t4TuPwP99VYQNtflv9o=
sha1:hgOpYQfsl9zT6oQ9M4wPeM6pwbw=
 by: Tim Rentsch - Fri, 19 Apr 2024 15:26 UTC

Michael S <already5chosen@yahoo.com> writes:

> On Mon, 15 Apr 2024 20:36:58 +0200
> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
>
>> Algol 68 and C are so different that mutual understanding might be
>> difficult depending on personal background, focus, and fantasy. :-)
>
> Interesting take.
> I never learned Algol-68, but from pieces of info that I occasionally
> got I was always thinking of it as rather similar to 'C'.
> Both languages originated from common ancestor (Algol-60) and changed
> it in similar directions, e.g. blurring the line between operators and
> expression, making function pointers first class citizen, allowing
> declaration of variables at block scope.
> I think, in the past, when I remembered more about Algol-68, I had seen
> more similarities.

Algol 60 already had block scope declarations.

Algol 60 may not have had (pointer to) function/procedure variables,
but it did allow procedure identifiers as arguments to a procedure
call, and procedure variables are an obvious generalization.

Relative to Algol 60, C slightly expanded what forms are allowed in
expressions, but mainly as a way to simplify the language syntax:

* no separate cases for assignment / function call statements

* so for()'s are more general and don't need specializing

In contrast, in Algol 68 the notion of "expression" is expanded
to allow the possibility of arbitrary variable declarations and
loops (IIANM; certainly I am not an expert on Algol 68).

Furthermore there are some significant differences between C and
Algol 60:

* Algol allows nested functions (aka procedures), but C doesn't

* Algol has call by name, C is strictly call by value

* Arrays are first class types in Algol, but not in C (and C
has pointer arithmetic as an essential part of the language,
which TTBOMK is not the case in any Algol-derived language)

* Algol is "strict" whereas C is "lax" - for example, in Algol
the controlling expression of an 'if' statement must be a
'Boolean expression', whereas in C it's just any expression

To me, Algol 68 represents an expansion and extension of the
Algol 60 language philosophy, whereas C represents a deliberate
departure from that philosophy; not necessarily a radical
departure, but a departure nonetheless. Certainly C has some
similarities to Algol 68, but I wouldn't say C and Algol 68
are similar languages, only that they have a few similarities.

Re: Recursion, Yo

<SGyUN.531$Xphd.48@fx41.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.swapon.de!news.mixmin.net!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!193.141.40.65.MISMATCH!npeer.as286.net!npeer-ng0.as286.net!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx41.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> <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> <uvhm89$3s6na$2@dont-email.me> <uvi79d$2ubl$1@dont-email.me> <uvjs4c$ebsr$1@dont-email.me> <20240416231134.00004066@yahoo.com> <86edb1xtjf.fsf@linuxsc.com>
Lines: 26
Message-ID: <SGyUN.531$Xphd.48@fx41.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Fri, 19 Apr 2024 18:25:54 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Fri, 19 Apr 2024 18:25:54 GMT
X-Received-Bytes: 2246
 by: Scott Lurndal - Fri, 19 Apr 2024 18:25 UTC

Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>Michael S <already5chosen@yahoo.com> writes:
>
>> On Mon, 15 Apr 2024 20:36:58 +0200
>> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
>>
>>> Algol 68 and C are so different that mutual understanding might be
>>> difficult depending on personal background, focus, and fantasy. :-)
>>
>> Interesting take.
>> I never learned Algol-68, but from pieces of info that I occasionally
>> got I was always thinking of it as rather similar to 'C'.
>> Both languages originated from common ancestor (Algol-60) and changed
>> it in similar directions, e.g. blurring the line between operators and
>> expression, making function pointers first class citizen, allowing
>> declaration of variables at block scope.
>> I think, in the past, when I remembered more about Algol-68, I had seen
>> more similarities.
>
>Algol 60 already had block scope declarations.
>
>Algol 60 may not have had (pointer to) function/procedure variables,
>but it did allow procedure identifiers as arguments to a procedure
>call, and procedure variables are an obvious generalization.

Call-by-name.

Re: Recursion, Yo

<uvudfv$352i4$1@dont-email.me>

  copy mid

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

  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, 19 Apr 2024 19:34:40 +0100
Organization: A noiseless patient Spider
Lines: 76
Message-ID: <uvudfv$352i4$1@dont-email.me>
References: <uut24f$2icpb$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> <uvhm89$3s6na$2@dont-email.me>
<uvi79d$2ubl$1@dont-email.me> <uvjs4c$ebsr$1@dont-email.me>
<20240416231134.00004066@yahoo.com> <86edb1xtjf.fsf@linuxsc.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 19 Apr 2024 20:34:40 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d4e5c5a145d29e3635cfa4bb0d7129a7";
logging-data="3312196"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+l0se9x9MJZXSdfVJLzpdn"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:xMPuoI82lSDpysTAlNKlwj3k9A8=
Content-Language: en-GB
In-Reply-To: <86edb1xtjf.fsf@linuxsc.com>
 by: bart - Fri, 19 Apr 2024 18:34 UTC

On 19/04/2024 16:26, Tim Rentsch wrote:
> Michael S <already5chosen@yahoo.com> writes:
>
>> On Mon, 15 Apr 2024 20:36:58 +0200
>> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
>>
>>> Algol 68 and C are so different that mutual understanding might be
>>> difficult depending on personal background, focus, and fantasy. :-)
>>
>> Interesting take.
>> I never learned Algol-68, but from pieces of info that I occasionally
>> got I was always thinking of it as rather similar to 'C'.
>> Both languages originated from common ancestor (Algol-60) and changed
>> it in similar directions, e.g. blurring the line between operators and
>> expression, making function pointers first class citizen, allowing
>> declaration of variables at block scope.
>> I think, in the past, when I remembered more about Algol-68, I had seen
>> more similarities.
>
> Algol 60 already had block scope declarations.
>
> Algol 60 may not have had (pointer to) function/procedure variables,
> but it did allow procedure identifiers as arguments to a procedure
> call, and procedure variables are an obvious generalization.
>
> Relative to Algol 60, C slightly expanded what forms are allowed in
> expressions, but mainly as a way to simplify the language syntax:
>
> * no separate cases for assignment / function call statements
>
> * so for()'s are more general and don't need specializing
>
> In contrast, in Algol 68 the notion of "expression" is expanded
> to allow the possibility of arbitrary variable declarations and
> loops (IIANM; certainly I am not an expert on Algol 68).
>
> Furthermore there are some significant differences between C and
> Algol 60:
>
> * Algol allows nested functions (aka procedures), but C doesn't
>
> * Algol has call by name, C is strictly call by value
>
> * Arrays are first class types in Algol, but not in C (and C
> has pointer arithmetic as an essential part of the language,
> which TTBOMK is not the case in any Algol-derived language)
>
> * Algol is "strict" whereas C is "lax" - for example, in Algol
> the controlling expression of an 'if' statement must be a
> 'Boolean expression', whereas in C it's just any expression
>
> To me, Algol 68 represents an expansion and extension of the
> Algol 60 language philosophy, whereas C represents a deliberate
> departure from that philosophy; not necessarily a radical
> departure, but a departure nonetheless. Certainly C has some
> similarities to Algol 68, but I wouldn't say C and Algol 68
> are similar languages, only that they have a few similarities.

I can't see any connection between Algol68 and C; I'm surprised at
people who say they do.

C was put together together as a systems language to do a job, not to
implemement some esoteric concept of a language that few could understand.

I understood it was based on languages like B and BCPL.

Actually there is a closer connection between my systems language,
created 10 years after C, which was also created for purely practical
purposes, and Algol68, largely because I borrowed much of its syntax
(including the interchangeability of statements and expressions).

But I would be first to admit that the similarity stops there.

Re: Recursion, Yo

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

  copy mid

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

  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, 19 Apr 2024 12:15:52 -0700
Organization: None to speak of
Lines: 35
Message-ID: <87cyqlqi3b.fsf@nosuchdomain.example.com>
References: <uut24f$2icpb$1@dont-email.me> <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> <uvhm89$3s6na$2@dont-email.me>
<uvi79d$2ubl$1@dont-email.me> <uvjs4c$ebsr$1@dont-email.me>
<20240416231134.00004066@yahoo.com> <86edb1xtjf.fsf@linuxsc.com>
<SGyUN.531$Xphd.48@fx41.iad>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Fri, 19 Apr 2024 21:15:52 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="9cfd4108308aa1ec221847dfe3a8c5d9";
logging-data="3328644"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX187zuXDiSF38kLeuyLZtMF5"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:Z35rGBokW/qVnmXBgnRQejrY4TY=
sha1:lQHgJ8tEtOkYEee03AEwl4a6wXU=
 by: Keith Thompson - Fri, 19 Apr 2024 19:15 UTC

scott@slp53.sl.home (Scott Lurndal) writes:
> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>Michael S <already5chosen@yahoo.com> writes:
>>
>>> On Mon, 15 Apr 2024 20:36:58 +0200
>>> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
>>>
>>>> Algol 68 and C are so different that mutual understanding might be
>>>> difficult depending on personal background, focus, and fantasy. :-)
>>>
>>> Interesting take.
>>> I never learned Algol-68, but from pieces of info that I occasionally
>>> got I was always thinking of it as rather similar to 'C'.
>>> Both languages originated from common ancestor (Algol-60) and changed
>>> it in similar directions, e.g. blurring the line between operators and
>>> expression, making function pointers first class citizen, allowing
>>> declaration of variables at block scope.
>>> I think, in the past, when I remembered more about Algol-68, I had seen
>>> more similarities.
>>
>>Algol 60 already had block scope declarations.
>>
>>Algol 60 may not have had (pointer to) function/procedure variables,
>>but it did allow procedure identifiers as arguments to a procedure
>>call, and procedure variables are an obvious generalization.
>
> Call-by-name.

Yes, the article you replied to already mentioned call by name, in text
that you snipped.

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

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

  copy mid

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

  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, 19 Apr 2024 12:18:19 -0700
Organization: None to speak of
Lines: 12
Message-ID: <878r19qhz8.fsf@nosuchdomain.example.com>
References: <uut24f$2icpb$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>
<uvhm89$3s6na$2@dont-email.me> <uvi79d$2ubl$1@dont-email.me>
<uvjs4c$ebsr$1@dont-email.me> <20240416231134.00004066@yahoo.com>
<86edb1xtjf.fsf@linuxsc.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Fri, 19 Apr 2024 21:18:20 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="9cfd4108308aa1ec221847dfe3a8c5d9";
logging-data="3328644"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/vSjUG0MzZWdoYGG6kXxJu"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:RmAl6TRVqOIJZ3CqNJDrisicmg4=
sha1:N9WOlUMFdXg5D5PPRjRl4CADw34=
 by: Keith Thompson - Fri, 19 Apr 2024 19:18 UTC

Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
[...]
> * Algol is "strict" whereas C is "lax" - for example, in Algol
> the controlling expression of an 'if' statement must be a
> 'Boolean expression', whereas in C it's just any expression

Small quibble: the controlling expression in C must be of scalar type.

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

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

  copy mid

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

  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: Sat, 20 Apr 2024 02:11:15 +0100
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <87wmosn8i4.fsf@bsb.me.uk>
References: <uut24f$2icpb$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> <uvhm89$3s6na$2@dont-email.me>
<uvi79d$2ubl$1@dont-email.me> <uvjs4c$ebsr$1@dont-email.me>
<20240416231134.00004066@yahoo.com> <86edb1xtjf.fsf@linuxsc.com>
<uvudfv$352i4$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sat, 20 Apr 2024 03:11:17 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="da89b1e60582327ec7de6a5e93dd6c72";
logging-data="3466166"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+fwpmgAWfsj2ONEnpArF+KbDDP2+EbWuo="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:pCpsvSEUDFgxJY5tKiEJ6rFCSRk=
sha1:HQRp3BRkSGCY755fUFsavgcXicE=
X-BSB-Auth: 1.61448079aeac3a9a990a.20240420021115BST.87wmosn8i4.fsf@bsb.me.uk
 by: Ben Bacarisse - Sat, 20 Apr 2024 01:11 UTC

bart <bc@freeuk.com> writes:

> On 19/04/2024 16:26, Tim Rentsch wrote:
....
>> ... Certainly C has some
>> similarities to Algol 68, but I wouldn't say C and Algol 68
>> are similar languages, only that they have a few similarities.
>
> I can't see any connection between Algol68 and C; I'm surprised at people
> who say they do.

"Connection" is vague, but Dennis Ritchie has written about the
influence of Algol 68 on C.

> C was put together together as a systems language to do a job, not to
> implemement some esoteric concept of a language that few could understand.
>
> I understood it was based on languages like B and BCPL.

BCPL had assignment statements but B followed Algol 68 and made
assignment an expression operator (along with the +=, -= etc versions).
This, of course, fed directly into C.

DMR also cites Algol 68's type composition as an influence on C's type
semantics, and casts come straight from Algol 68.

--
Ben.


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

Pages:12345
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor