Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Every program is a part of some other program, and rarely fits.


devel / comp.lang.misc / Re: Zero-based or one-based indexing

SubjectAuthor
* Zero-based or one-based indexingJames Harris
+* Re: Zero-based or one-based indexingDmitry A. Kazakov
|`* Re: Zero-based or one-based indexingJames Harris
| `* Re: Zero-based or one-based indexingDmitry A. Kazakov
|  `* Re: Zero-based or one-based indexingJames Harris
|   `* Re: Zero-based or one-based indexingDmitry A. Kazakov
|    `* Re: Zero-based or one-based indexingJames Harris
|     +- Re: Zero-based or one-based indexingDmitry A. Kazakov
|     `* Re: Zero-based or one-based indexingDavid Brown
|      `* Re: Zero-based or one-based indexingJames Harris
|       +* Re: Zero-based or one-based indexingDavid Brown
|       |`- Re: Zero-based or one-based indexingJames Harris
|       `- Re: Zero-based or one-based indexingAndy Walker
+* Re: Zero-based or one-based indexingBart
|`* Re: Zero-based or one-based indexingJames Harris
| `* Re: Zero-based or one-based indexingBart
|  `* Re: Zero-based or one-based indexingJames Harris
|   +* Re: Zero-based or one-based indexingBart
|   |`- Re: Zero-based or one-based indexingJames Harris
|   `* Re: Zero-based or one-based indexingDavid Brown
|    +* Re: Zero-based or one-based indexingBart
|    |`- Re: Zero-based or one-based indexingDavid Brown
|    `- Re: Zero-based or one-based indexingJames Harris
+* Re: Zero-based or one-based indexingAndy Walker
|`* Re: Zero-based or one-based indexingDavid Brown
| +* Re: Zero-based or one-based indexingBart
| |`* Re: Zero-based or one-based indexingDavid Brown
| | `- Re: Zero-based or one-based indexingBart
| `* Re: Zero-based or one-based indexingAndy Walker
|  +* Re: Zero-based or one-based indexingDavid Brown
|  |+* Re: Zero-based or one-based indexingAndy Walker
|  ||`* Re: Zero-based or one-based indexingDavid Brown
|  || `* Re: Zero-based or one-based indexingAndy Walker
|  ||  `* Re: Zero-based or one-based indexingDavid Brown
|  ||   `* Re: Zero-based or one-based indexingAndy Walker
|  ||    `- Re: Zero-based or one-based indexingDavid Brown
|  |`- Re: Zero-based or one-based indexingluserdroog
|  `- Re: Zero-based or one-based indexingBakul Shah
+- Re: Zero-based or one-based indexingStefan Ram
`* Re: Zero-based or one-based indexingRod Pemberton
 +* Re: Zero-based or one-based indexingBart
 |`- Re: Zero-based or one-based indexingRod Pemberton
 `* Re: Zero-based or one-based indexingDavid Brown
  `* Re: Zero-based or one-based indexingRod Pemberton
   +* Re: Zero-based or one-based indexingBart
   |`* Re: Zero-based or one-based indexingDavid Brown
   | `* Re: Zero-based or one-based indexingBart
   |  `* Re: Zero-based or one-based indexingDavid Brown
   |   +* Re: Zero-based or one-based indexingBart
   |   |`* Re: Zero-based or one-based indexingDavid Brown
   |   | `* Re: Zero-based or one-based indexingBart
   |   |  +- Re: Zero-based or one-based indexingBart
   |   |  `* Re: Zero-based or one-based indexingDavid Brown
   |   |   +* Re: Zero-based or one-based indexingBart
   |   |   |+* Re: Zero-based or one-based indexingDavid Brown
   |   |   ||+- Re: Zero-based or one-based indexingBart
   |   |   ||`- Re: Zero-based or one-based indexingRod Pemberton
   |   |   |`* Re: Zero-based or one-based indexingRod Pemberton
   |   |   | `- Re: Zero-based or one-based indexingBart
   |   |   +* Re: Zero-based or one-based indexingBart
   |   |   |`* Re: Zero-based or one-based indexingDavid Brown
   |   |   | `- Re: Zero-based or one-based indexingRod Pemberton
   |   |   `* Re: Zero-based or one-based indexingRod Pemberton
   |   |    `- Re: Zero-based or one-based indexingDavid Brown
   |   `* Re: Zero-based or one-based indexingantispam
   |    `* Re: Zero-based or one-based indexingDavid Brown
   |     `* Re: Zero-based or one-based indexingantispam
   |      `* Re: Zero-based or one-based indexingDavid Brown
   |       `* Re: Zero-based or one-based indexingantispam
   |        `- Re: Zero-based or one-based indexingDavid Brown
   `* Re: Zero-based or one-based indexingDavid Brown
    `* Re: Zero-based or one-based indexingluserdroog
     `* Re: Zero-based or one-based indexingDavid Brown
      `* Re: Zero-based or one-based indexingBart
       `* Re: Zero-based or one-based indexingDavid Brown
        `* Re: Zero-based or one-based indexingBart
         `- Re: Zero-based or one-based indexingDavid Brown

Pages:1234
Re: Zero-based or one-based indexing

<ul2mrs$2bo9s$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2176&group=comp.lang.misc#2176

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anw@cuboid.co.uk (Andy Walker)
Newsgroups: comp.lang.misc
Subject: Re: Zero-based or one-based indexing
Date: Sat, 9 Dec 2023 21:40:12 +0000
Organization: Not very much
Lines: 59
Message-ID: <ul2mrs$2bo9s$1@dont-email.me>
References: <so4m42$kee$1@dont-email.me> <so4q96$rcq$1@gioia.aioe.org>
<sob0dd$4ji$1@dont-email.me> <sob1sr$g2h$1@gioia.aioe.org>
<sobaf2$fas$1@dont-email.me> <sobbhi$1118$1@gioia.aioe.org>
<sobek8$b7b$1@dont-email.me> <socmr2$u5n$1@dont-email.me>
<ukvqor$1rqeh$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 9 Dec 2023 21:40:12 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="27a370a07f2b723f714cde0314a0a6fb";
logging-data="2482492"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19p0Kz/+MxCWFfIzpCUpZoa"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:WLUfPX2CVCjDdlgLgbKBBj/ztCs=
Content-Language: en-GB
In-Reply-To: <ukvqor$1rqeh$1@dont-email.me>
 by: Andy Walker - Sat, 9 Dec 2023 21:40 UTC

On 08/12/2023 19:28, James Harris wrote:
> [...] To illustrate, I was
> proposing that in a function, f, one could have
> return h
> which would /conceptually/ return the address of h (which I guess in
> Algol terms means it would return h rather than the value of h).

In Algol terms, it would return "h" coerced to the declared
type of the function. That could be "h" itself, if it already has
that type, but more generally could involve any of the coercions
available to the compiler, singly or combined together as defined
in the syntax by the Revised Report. Some notes:

-- An applied occurrence of an identifier in Algol /always/ means
a priori the object defined by the defining occurrence of that
identifier.

-- The return value from a function is a "strong" position; the
compiler knows exactly, from the declaration of the function,
what type is required. So all available coercions can be used.
This is in contrast to other positions, such as operands and
the LHS of an assignment, where only some coercions are allowed.
This is all defined by the syntax, which is carefully designed
to be unambiguous.

-- If "h" is a variable, ie an address in the computer, then "h"
/is/ that address. If you want to use instead the value at that
address, then "h" must be dereferenced, almost always implicitly,
in accordance with the syntax.

-- Trying to explain all this always makes Algol seem much more
complicated than it really is. IRL, everything just works, and
does so in a natural and convenient way. C-style languages go
around the houses to achieve the same effects, but we are all
[sadly] used to that.

> Crucially, and perhaps at variance with Algol (I don't know) the
> value of h (i.e. the value at the returned address) would be
> read-only to the caller.

Algol has no concept of "read-only variables". There were
some proposals for "in" and "out" parameters, but they never got any
real traction. So, in the present context, it depends on what the
returned value is. Eg, a procedure returning int of course returns
something "read only"; you can't overwrite [eg] 2 with 3. If OTOH
it returns a variable [such as a "ref int"], a place in the computer,
then you can [also of course] change what value is stored there.
Thus, "2 := 3" is forbidden, but "int h := 2; ...; h := 3;" is fine.
Then you can't change "h" [it will remain the same place], but you
can [of course] change whether a pointer points at "h" or at some
other place. [The use of "letter aleph" in the RR, which creates
identifiers known to the OS but that a programmer cannot access in
the program, solves many, but not all, of the real-life problems for
which other languages need "const".]

--
Andy Walker, Nottingham.
Andy's music pages: www.cuboid.me.uk/andy/Music
Composer of the day: www.cuboid.me.uk/andy/Music/Composers/Richards

Re: Zero-based or one-based indexing

<ula02l$3n876$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2178&group=comp.lang.misc#2178

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: james.harris.1@gmail.com (James Harris)
Newsgroups: comp.lang.misc
Subject: Re: Zero-based or one-based indexing
Date: Tue, 12 Dec 2023 16:00:21 +0000
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <ula02l$3n876$1@dont-email.me>
References: <so4m42$kee$1@dont-email.me> <so4q96$rcq$1@gioia.aioe.org>
<sob0dd$4ji$1@dont-email.me> <sob1sr$g2h$1@gioia.aioe.org>
<sobaf2$fas$1@dont-email.me> <sobbhi$1118$1@gioia.aioe.org>
<sobek8$b7b$1@dont-email.me> <socmr2$u5n$1@dont-email.me>
<ukvqor$1rqeh$1@dont-email.me> <ul1tsi$27t24$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 12 Dec 2023 16:00:21 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e25f27a5e3c98805fc6686c7061945c2";
logging-data="3907814"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+KT31NMRqgcnlQQCSHLFz5sJ+vBliw4cI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:wbezqc0urkCG+mO2ciiiMolNOg0=
Content-Language: en-GB
In-Reply-To: <ul1tsi$27t24$2@dont-email.me>
 by: James Harris - Tue, 12 Dec 2023 16:00 UTC

On 09/12/2023 14:33, David Brown wrote:
> On 08/12/2023 20:28, James Harris wrote:
>> On 03/12/2021 09:08, David Brown wrote:
>>> On 02/12/2021 22:42, James Harris wrote:
>>>> On 02/12/2021 20:49, Dmitry A. Kazakov wrote:
>>>>> On 2021-12-02 21:31, James Harris wrote:
>>>>
>>>> ...
>>>>
>>>>>> But to the point, are you comfortable with the idea of the A(2) in
>>>>>>
>>>>>>     x = A(2) + 0
>>>>>>
>>>>>> meaning the same mapping result as the A(2) in
>>>>>>
>>>>>>     A(2) = 0
>>>>>>
>>>>>> ?
>>>>>
>>>>> Yes, in both cases the result is the array element corresponding to
>>>>> the index 2. That is the semantics of A(2).
>>>>
>>>> Cool. If A were, instead, a function that, say, ended with
>>>>
>>>>    return v
>>>>
>>>> then what would you want those A(2)s to mean and should they still mean
>>>> the same as each other? The latter expression would look strange to
>>>> many.
>>>>
>>>
>>> Do you mean like returning a reference in C++ style?
>>
>> Hi David, apologies for not replying before. I was just now looking
>> for old posts that were outstanding in some way. (There may be many
>> which I have yet to reply to like your one.)
>>
>> I probably left your post until I found out about C++ references and
>> never got round to reading up on them.
>>
>
> I saw my post was dated 03.12 (or 12.03, for any date-backwards
> Americans in the audience) and thought it was strange that I'd forgotten
> the post from 5 days ago.  Then I noticed the year...

At the time I had to drop out of Usenet for a while but was aware that
there was a number of posts which should be replied to. I'll try to get
to some of the others, as well.

--
James Harris

Pages:1234
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor