Path: csiph.com!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: 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: <_zSRN.161297$m4d.144795@fx43.iad> <20240411075825.30@kylheku.com> <20240413203303.000001f9@yahoo.com> <878r1grgn3.fsf@bsb.me.uk> <20240414032902.00003dc8@yahoo.com> 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= Xref: csiph.com comp.lang.c:384344 Janis Papanagnou writes: > On 14.04.2024 02:29, Michael S wrote: >> On Sun, 14 Apr 2024 00:23:44 +0100 >> Ben Bacarisse wrote: >> >>> Michael S writes: >>> >>>> On Sat, 13 Apr 2024 00:13:36 -0000 (UTC) >>>> 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. >>>> >>>> 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 */