Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Beeping is cute, if you are in the office ;) -- Alan Cox


devel / comp.lang.misc / Re: Dereference relative to increment and decrement operators ++ --

SubjectAuthor
* Dereference relative to increment and decrement operators ++ --James Harris
+* Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|`* Re: Dereference relative to increment and decrement operators ++ --James Harris
| `* Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|  +* Re: Dereference relative to increment and decrement operators ++ --Bart
|  |+* Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|  ||+- Re: Dereference relative to increment and decrement operators ++ --Bart
|  ||`* Re: Dereference relative to increment and decrement operators ++ --James Harris
|  || `* Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|  ||  `* Re: Dereference relative to increment and decrement operators ++ --James Harris
|  ||   `* Re: Dereference relative to increment and decrement operators ++ --Stefan Ram
|  ||    `* Re: Dereference relative to increment and decrement operators ++ --James Harris
|  ||     `* Re: Dereference relative to increment and decrement operators ++ --Stefan Ram
|  ||      `* Re: Dereference relative to increment and decrement operators ++ --James Harris
|  ||       +* Re: Dereference relative to increment and decrement operators ++ --Stefan Ram
|  ||       |`- Re: Dereference relative to increment and decrement operators ++ --James Harris
|  ||       `* Re: Dereference relative to increment and decrement operators ++ --David Brown
|  ||        `* Re: Dereference relative to increment and decrement operators ++ --James Harris
|  ||         `* Re: Dereference relative to increment and decrement operators ++ --David Brown
|  ||          `* Re: Dereference relative to increment and decrement operators ++ --James Harris
|  ||           `* Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|  ||            `* Re: Dereference relative to increment and decrement operators ++ --James Harris
|  ||             `* Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|  ||              `- Re: Dereference relative to increment and decrement operators ++ --James Harris
|  |`* Re: Dereference relative to increment and decrement operators ++ --David Brown
|  | `* Re: Dereference relative to increment and decrement operators ++ --James Harris
|  |  `- Re: Dereference relative to increment and decrement operators ++ --David Brown
|  `* Re: Dereference relative to increment and decrement operators ++ --James Harris
|   `* Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|    `* Re: Dereference relative to increment and decrement operators ++ --James Harris
|     +* Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|     |`* Re: Dereference relative to increment and decrement operators ++ --James Harris
|     | `* Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|     |  `* Re: Dereference relative to increment and decrement operators ++ --Bart
|     |   +* Re: Dereference relative to increment and decrement operators ++ --James Harris
|     |   |`* Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|     |   | +* Re: Dereference relative to increment and decrement operators ++ --James Harris
|     |   | |`* Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|     |   | | `* Re: Dereference relative to increment and decrement operators ++ --James Harris
|     |   | |  `* Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|     |   | |   +* Re: Dereference relative to increment and decrement operators ++ --Bart
|     |   | |   |+- Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|     |   | |   |`- Re: Dereference relative to increment and decrement operators ++ --James Harris
|     |   | |   `* Re: Dereference relative to increment and decrement operators ++ --James Harris
|     |   | |    `* Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|     |   | |     +* Re: Dereference relative to increment and decrement operators ++ --Bart
|     |   | |     |`* Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|     |   | |     | `* Re: Dereference relative to increment and decrement operators ++ --Bart
|     |   | |     |  +- Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|     |   | |     |  `* Re: Dereference relative to increment and decrement operators ++ --James Harris
|     |   | |     |   `- Re: Dereference relative to increment and decrement operators ++ --Bart
|     |   | |     `* Re: Dereference relative to increment and decrement operators ++ --James Harris
|     |   | |      `* Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|     |   | |       `* Re: Dereference relative to increment and decrement operators ++ --James Harris
|     |   | |        `- Re: Dereference relative to increment and decrement operators ++ --James Harris
|     |   | `- Re: Dereference relative to increment and decrement operators ++ --Bart
|     |   `- Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
|     `* Re: Dereference relative to increment and decrement operators ++ --Andy Walker
|      `- Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
+* Re: Dereference relative to increment and decrement operators ++ --Bart
|+* Re: Dereference relative to increment and decrement operators ++ --David Brown
||`* Re: Dereference relative to increment and decrement operators ++ --Bart
|| `- Re: Dereference relative to increment and decrement operators ++ --David Brown
|+* Re: Dereference relative to increment and decrement operators ++ --James Harris
||+- Re: Dereference relative to increment and decrement operators ++ --James Harris
||`* Re: Dereference relative to increment and decrement operators ++ --Bart
|| `* Re: Dereference relative to increment and decrement operators ++ --James Harris
||  `* Re: Dereference relative to increment and decrement operators ++ --Bart
||   `* Re: Dereference relative to increment and decrement operators ++ --James Harris
||    `* Re: Dereference relative to increment and decrement operators ++ --Bart
||     `- Re: Dereference relative to increment and decrement operators ++ --James Harris
|`- Re: Dereference relative to increment and decrement operators ++ --James Harris
`* Re: Dereference relative to increment and decrement operators ++ --David Brown
 +* Re: Dereference relative to increment and decrement operators ++ --Bart
 |`* Re: Dereference relative to increment and decrement operators ++ --David Brown
 | +* Re: Dereference relative to increment and decrement operators ++ --Bart
 | |`* Re: Dereference relative to increment and decrement operators ++ --David Brown
 | | `* Re: Dereference relative to increment and decrement operators ++ --Bart
 | |  `* Re: Dereference relative to increment and decrement operators ++ --David Brown
 | |   `* Re: Dereference relative to increment and decrement operators ++ --Bart
 | |    +* Re: Dereference relative to increment and decrement operators ++ --Dmitry A. Kazakov
 | |    |`* Re: Dereference relative to increment and decrement operators ++ --Bart
 | |    | `- Re: Dereference relative to increment and decrement operators ++ --David Brown
 | |    `* Re: Dereference relative to increment and decrement operators ++ --David Brown
 | |     `* Re: Dereference relative to increment and decrement operators ++ --Bart
 | |      `* Re: Dereference relative to increment and decrement operators ++ --David Brown
 | |       `* Re: Dereference relative to increment and decrement operators ++ --Bart
 | |        `- Re: Dereference relative to increment and decrement operators ++ --David Brown
 | `* Re: Dereference relative to increment and decrement operators ++ --James Harris
 |  `* Re: Dereference relative to increment and decrement operators ++ --David Brown
 |   `* Re: Dereference relative to increment and decrement operators ++ --James Harris
 |    `* Re: Dereference relative to increment and decrement operators ++ --David Brown
 |     +* Re: Dereference relative to increment and decrement operators ++ --James Harris
 |     |+* Re: Dereference relative to increment and decrement operators ++ --Bart
 |     ||`* Re: Dereference relative to increment and decrement operators ++ --James Harris
 |     || `* Re: Dereference relative to increment and decrement operators ++ --Bart
 |     ||  `* Re: Dereference relative to increment and decrement operators ++ --James Harris
 |     ||   `- Re: Dereference relative to increment and decrement operators ++ --David Brown
 |     |`* Re: Dereference relative to increment and decrement operators ++ --David Brown
 |     | `* Re: Dereference relative to increment and decrement operators ++ --James Harris
 |     |  `* Re: Dereference relative to increment and decrement operators ++ --David Brown
 |     `* Re: Dereference relative to increment and decrement operators ++ --Bart
 `* Re: Dereference relative to increment and decrement operators ++ --James Harris

Pages:1234567
Re: Dereference relative to increment and decrement operators ++ --

<tkrfk0$1gtkg$3@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: james.harris.1@gmail.com (James Harris)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Sun, 13 Nov 2022 19:13:04 +0000
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <tkrfk0$1gtkg$3@dont-email.me>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkb6ud$i6r$1@gioia.aioe.org> <tkbb1n$muh$1@gioia.aioe.org>
<tkr3v0$1frm6$2@dont-email.me> <tkr5qt$1r7b$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 13 Nov 2022 19:13:05 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="45c540c812ba7e7a9f8aaaa580905047";
logging-data="1603216"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Y1sbmwtBd/RtY2Ry2hyJbbUVBwVyiVq0="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:wsHrs0W3X3szfO0b5usZQ5OCMTE=
Content-Language: en-GB
In-Reply-To: <tkr5qt$1r7b$1@gioia.aioe.org>
 by: James Harris - Sun, 13 Nov 2022 19:13 UTC

On 13/11/2022 16:26, Dmitry A. Kazakov wrote:
> On 2022-11-13 16:54, James Harris wrote:
>> On 07/11/2022 16:16, Dmitry A. Kazakov wrote:
>
>>> ++ means cheap keyboard with broken keys or coffee spilled over it...
>>> (:-))
>>
>> A bit like Ada's --, then. ;-)
>
> In Ada -- is a comment, not operator.

Indeed.

>
> An interesting question regarding operator's symbol is: sticking to
> ASCII or going Unicode. Let's say we wanted an increment operator (I do
> not). Why ++ from 60's? Take the increment (∆) or the upwards arrow ↑ etc.

As you know, I don't like Unicode for program source. It can be hard to
type, hard to read aloud, and hard to compare when two glyphs look the
same but have different encodings. A small set of characters such as
ASCII has none of those problems.

As for replacing ++ with something else I have tried things like

+> prefix increment
<+ postfix increment

or maybe ++> and <++.

But I don't know if programmers in general would care for them.

>
> Note that all arguments against Unicode apply to operators. If the thing
> is difficult to type then it is difficult to remember: precedence level,
> associativity, semantics. If you can hold these in your head, you could
> remember the key combination as well. If you do not, then, maybe, having
> a subprogram Increment() would be better choice?

Agreed.

--
James Harris

Re: Dereference relative to increment and decrement operators ++ --

<tkrftl$1gtkg$4@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: james.harris.1@gmail.com (James Harris)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Sun, 13 Nov 2022 19:18:12 +0000
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <tkrftl$1gtkg$4@dont-email.me>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkbf52$3kmic$1@dont-email.me> <tkbgnf$1nd8$1@gioia.aioe.org>
<tkd2j6$3s35k$1@dont-email.me> <tkd3lv$1g9o$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 13 Nov 2022 19:18:13 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="45c540c812ba7e7a9f8aaaa580905047";
logging-data="1603216"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18DETI6E4R8uqwC0vLVx67cLBxRnA0RCLg="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:oBlfMhwTbCxfuWdDWkZBsZhoRVU=
In-Reply-To: <tkd3lv$1g9o$1@gioia.aioe.org>
Content-Language: en-GB
 by: James Harris - Sun, 13 Nov 2022 19:18 UTC

On 08/11/2022 08:23, Dmitry A. Kazakov wrote:
> On 2022-11-08 09:04, James Harris wrote:
>
>> I like the simplicity of the language which would result from your
>> suggestions but can't help but think they would make programming in it
>> less comfortable, like the simplicity of a hair shirt. ;)
>
> If you think programmers are dying to write stuff like *p++=*q++; you
> are wrong. Actually that train left the station. Today C++ fun is
> templates. It is monstrous instantiations over instantiations barely
> resembling program code. Modern times is a glorious combination of
> Python performance with K&R C readability! (:-))

Contrast

*p := *q
p := p + 1
q := q + 1

Perhaps

+p++ := *q++

expresses that part of the algorithm in a way which is more natural and
easier to read...?

--
James Harris

Re: Dereference relative to increment and decrement operators ++ --

<Unicode-20221113202832@ram.dialup.fu-berlin.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: 13 Nov 2022 19:30:13 GMT
Organization: Stefan Ram
Lines: 24
Expires: 1 Sep 2023 11:59:58 GMT
Message-ID: <Unicode-20221113202832@ram.dialup.fu-berlin.de>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org> <tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org> <tkb6ud$i6r$1@gioia.aioe.org> <tkbb1n$muh$1@gioia.aioe.org> <tkr3v0$1frm6$2@dont-email.me> <tkr5qt$1r7b$1@gioia.aioe.org> <tkrfk0$1gtkg$3@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de Kx2viXqXGA22+POmc2fM7AHw2YQc7wVUX5Fe0jGfKSKeWp
X-Copyright: (C) Copyright 2022 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Sun, 13 Nov 2022 19:30 UTC

James Harris <james.harris.1@gmail.com> writes:
>As you know, I don't like Unicode for program source. It can be hard to
>type, hard to read aloud, and hard to compare when two glyphs look the
>same but have different encodings. A small set of characters such as
>ASCII has none of those problems.

But it can be cumbersome to escape all quotation characters
in a string, as in "\"\\" in C.

Imagine one would use some obscure Unicode characters as
string delimiters. For example,

ᒪ CANADIAN SYLLABICS MA
ᒧ CANADIAN SYLLABICS MO

. Programmers will surely find a way to map them to their
keyboards somehow. Then that string literal would be just
ᒧ"\ᒪ!

(One would just have to use escapes in the rare case that
one really needs to have those Canadian syllabics ma or mo
within a string literal.)

Re: Dereference relative to increment and decrement operators ++ --

<tkrha4$1h3es$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: james.harris.1@gmail.com (James Harris)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Sun, 13 Nov 2022 19:41:56 +0000
Organization: A noiseless patient Spider
Lines: 139
Message-ID: <tkrha4$1h3es$2@dont-email.me>
References: <tkarnt$3ivof$1@dont-email.me> <tkb4d4$1795$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 13 Nov 2022 19:41:57 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="45c540c812ba7e7a9f8aaaa580905047";
logging-data="1609180"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+mDsTt3bhhxDtX6uWYuTjfpI4Ulb0cahI="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:90AMiAk15eWwFjyTv7pIbtijQzw=
Content-Language: en-GB
In-Reply-To: <tkb4d4$1795$1@gioia.aioe.org>
 by: James Harris - Sun, 13 Nov 2022 19:41 UTC

On 07/11/2022 14:23, Bart wrote:
> On 07/11/2022 11:55, James Harris wrote:

....

> For unary operators, the evaluation order is rather peculiar yet seems
> to be used in quite a few languages without anyone questioning it. So if
> `a b c d` are unary operators, then the following:
>
>    a b E c d
>
> is evaluated like this:
>
>       a (b ((E c) d))
>
> That is, first all the post-fix operators in left-to-right order, then
> all the prefix ones in right-left order. It sounds bizarre when put like
> that!

Indeed, right then left does sound unnatural, albeit that it's
relatively easy to remember. Could it be the comparative simplicity of
"right then left" is why C has postfix ++ of higher precedence than
prefix ++, even though that would be an awkward way to order such
operations?

>
>> Taking a step back and considering general expression evaluation I
>> have, so far, been defining the apparent order. And I'd like to
>> continue with that. So it should be possible to combine multiple ++
>> operators arbitrarily. For example,
>>
>>    ++E + E++
>
>
> This is well defined, as unary operators bind more tightly than binary
> ones. This is just (++E) + (++E).

Isn't it, rather,

(++E) + (E++)

?

>
> However the evaluation order for '+' is not usually well-defined, so you
> don't know which operand will be done first.
>
>>    ++E++
>
> This may not work, or not work as espected. The binding using my above
> scheme means this is equivalent to ++(E++).

Perhaps the scheme is wrong (for some definition of wrong)...?

IMO (++E)++ makes more sense.

> But the second ++ requires
> an lvalue as input, and yields an rvalue, which would be an invalid
> input to the first ++.

Better to give ++ (prefix) precedence over ++ (postfix), perhaps.

....

>> At any rate, that distinction between prefix and postfix ++ seems to
>> be recognised at the following link where it says "Prefix versions of
>> the built-in operators return references and postfix versions return
>> values."
>>
>>    https://en.cppreference.com/w/cpp/language/operator_incdec
>
> I tried to get ++E++ to work using a suitable type for E, but in my
> language it cannot work, as the first ++ still needs an lvalue; just an
> rvalue which has a pointer type won't cut it.
>
> However ++E++^ can work, where ^ is deref, and E is a pointer.
>
> I think this is because in my language, for something to be a valid
> lvalue, you need to be able to apply & address-of to it. The result of
> E++ doesn't have an address. But (E++)^ works because & and ^ cancel
> out. Or something...

As a guess, could your compiler be making an optimisation (coalescing
postincrement and dereference) in a way which contravenes the definition
of the operators?

>
>> Setting that aside aside ... and going back to the query, what should
>> be the relative precedences of the three operators? For example, how
>> should the following be evaluated?
>>
>>    ++E++^
>>    ++E^++
>>
>> Or should some ways of combining ^ with either or both of the ++
>> operators be prohibited because they make code too difficult to
>> understand?!!
>
> You have the same issues in C, but that's OK because people are so
> familiar with it. Also * deref is a prefix operator so you never have
> two distinct postfix operators, unless you write E++ --.
>
> But yes, parentheses are recommended when mixing certain prefix/postfix
> ops. I think this one is clear enough however:
>
>    -E^
>
> Deference E then negate the result. As is this: -E[i]; you wouldn't
> assume that meant (-E)[i].

Yes, of the operators you mention I have the precedence order as

array indexing
dereference
unary minus

Thus my expression parser ought to do the sensible thing in each case.
The example you give is interesting because IIRC you give all unary
prefix operators a very high precedence. ISTM that such an approach
could try to evaluate the above wrongly and that it may be better to
order precedences by what the operators consume and produce than just to
boost the precedences of prefix operators. A prime example is boolean
not. In

not a > b

the "a > b" part produces a boolean, which is a natural input to "not".
It is surely sensible to have all boolean consumers as of lower
precedence than operations which produce booleans rather than saying
that "not" has a higher precedence because it is a prefix operator. Your
choice, of course, but I know you appreciate a challenge. ;-)

--
James Harris

Re: Dereference relative to increment and decrement operators ++ --

<tkrieu$1h3es$3@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: james.harris.1@gmail.com (James Harris)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Sun, 13 Nov 2022 20:01:34 +0000
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <tkrieu$1h3es$3@dont-email.me>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkb6ud$i6r$1@gioia.aioe.org> <tkbb1n$muh$1@gioia.aioe.org>
<tkr3v0$1frm6$2@dont-email.me> <tkr5qt$1r7b$1@gioia.aioe.org>
<tkrfk0$1gtkg$3@dont-email.me>
<Unicode-20221113202832@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 13 Nov 2022 20:01:34 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="45c540c812ba7e7a9f8aaaa580905047";
logging-data="1609180"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+K2nLbiNimWIO3FVfb+apmsI654uZh6aw="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:yCfRhE5QQtJ4Yb0fCEzUJKCfZmc=
Content-Language: en-GB
In-Reply-To: <Unicode-20221113202832@ram.dialup.fu-berlin.de>
 by: James Harris - Sun, 13 Nov 2022 20:01 UTC

On 13/11/2022 19:30, Stefan Ram wrote:
> James Harris <james.harris.1@gmail.com> writes:
>> As you know, I don't like Unicode for program source. It can be hard to
>> type, hard to read aloud, and hard to compare when two glyphs look the
>> same but have different encodings. A small set of characters such as
>> ASCII has none of those problems.
>
> But it can be cumbersome to escape all quotation characters
> in a string, as in "\"\\" in C.

Rather than allowing non-ASCII in source I came up with a scheme of what
you might call 'named characters' extending the backslash idea of C to
allow names instead of single characters after the backslash. It's off
topic for this thread but it allows non-ASCII characters to be named
(such that the names consist of ASCII characters and would thus be
readable and universal).

>
> Imagine one would use some obscure Unicode characters as
> string delimiters. For example,
>
> ᒪ CANADIAN SYLLABICS MA
> ᒧ CANADIAN SYLLABICS MO
>
> . Programmers will surely find a way to map them to their
> keyboards somehow. Then that string literal would be just
> ᒧ"\ᒪ!

I cannot read that. Nor could many other programmers.

>
> (One would just have to use escapes in the rare case that
> one really needs to have those Canadian syllabics ma or mo
> within a string literal.)

--
James Harris

Re: Dereference relative to increment and decrement operators ++ --

<tkrjfu$757$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!aioe.org!pMM5B9Rl/1LQCd+Nt14ETA.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Sun, 13 Nov 2022 21:19:11 +0100
Organization: Aioe.org NNTP Server
Message-ID: <tkrjfu$757$1@gioia.aioe.org>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkbf52$3kmic$1@dont-email.me> <tkbgnf$1nd8$1@gioia.aioe.org>
<tkd2j6$3s35k$1@dont-email.me> <tkd3lv$1g9o$1@gioia.aioe.org>
<tkrftl$1gtkg$4@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="7335"; posting-host="pMM5B9Rl/1LQCd+Nt14ETA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.1
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Sun, 13 Nov 2022 20:19 UTC

On 2022-11-13 20:18, James Harris wrote:
> On 08/11/2022 08:23, Dmitry A. Kazakov wrote:
>> On 2022-11-08 09:04, James Harris wrote:
>>
>>> I like the simplicity of the language which would result from your
>>> suggestions but can't help but think they would make programming in
>>> it less comfortable, like the simplicity of a hair shirt. ;)
>>
>> If you think programmers are dying to write stuff like *p++=*q++; you
>> are wrong. Actually that train left the station. Today C++ fun is
>> templates. It is monstrous instantiations over instantiations barely
>> resembling program code. Modern times is a glorious combination of
>> Python performance with K&R C readability! (:-))
>
> Contrast
>
>   *p := *q
>   p := p + 1
>   q := q + 1
>
> Perhaps
>
>   +p++ := *q++
>
> expresses that part of the algorithm in a way which is more natural and
> easier to read...?

No algorithm requires you resort to pointers. With arrays it is plain
assignment:

p := q;

which BTW could be performed in parallel or by a single instruction on a
CISC machine or with a bunch optimizations. Consider the case when the
target object requires construction and destruction. Referencing would
need to construct a new object, destruct target, construct new target,
destruct copy. In Ada the compiler is allowed to skip the intermediates
and perform bitwise copy with "adjusting" the result.

The morale: low-level overly specified stuff is not only uncomfortable
and dangerous it is greatly inefficient in large scale programming.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Dereference relative to increment and decrement operators ++ --

<tkrl85$113l$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!aioe.org!uabYU4OOdxBKlV2hpj27FQ.user.46.165.242.75.POSTED!not-for-mail
From: bc@freeuk.com (Bart)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Sun, 13 Nov 2022 20:49:09 +0000
Organization: Aioe.org NNTP Server
Message-ID: <tkrl85$113l$1@gioia.aioe.org>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkbf52$3kmic$1@dont-email.me> <tkbgnf$1nd8$1@gioia.aioe.org>
<tkd2j6$3s35k$1@dont-email.me> <tkd3lv$1g9o$1@gioia.aioe.org>
<tkrftl$1gtkg$4@dont-email.me> <tkrjfu$757$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="33909"; posting-host="uabYU4OOdxBKlV2hpj27FQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
X-Notice: Filtered by postfilter v. 0.9.2
 by: Bart - Sun, 13 Nov 2022 20:49 UTC

On 13/11/2022 20:19, Dmitry A. Kazakov wrote:
> On 2022-11-13 20:18, James Harris wrote:
>> On 08/11/2022 08:23, Dmitry A. Kazakov wrote:
>>> On 2022-11-08 09:04, James Harris wrote:
>>>
>>>> I like the simplicity of the language which would result from your
>>>> suggestions but can't help but think they would make programming in
>>>> it less comfortable, like the simplicity of a hair shirt. ;)
>>>
>>> If you think programmers are dying to write stuff like *p++=*q++; you
>>> are wrong. Actually that train left the station. Today C++ fun is
>>> templates. It is monstrous instantiations over instantiations barely
>>> resembling program code. Modern times is a glorious combination of
>>> Python performance with K&R C readability! (:-))
>>
>> Contrast
>>
>>    *p := *q
>>    p := p + 1
>>    q := q + 1
>>
>> Perhaps
>>
>>    +p++ := *q++
>>
>> expresses that part of the algorithm in a way which is more natural
>> and easier to read...?
>
> No algorithm requires you resort to pointers. With arrays it is plain
> assignment:
>
>    p := q;

You're assuming this is part of a loop. But perhaps other things are
happening after each *p++ = *q++: the next source or dest might be
different, or the next transfer might be of a different type and/or size.

This is what makes such lower level operations so useful. A solution in
a higher level but more limiting language might require ingenuity to get
around the strictness.

> which BTW could be performed in parallel or by a single instruction on a
> CISC machine or with a bunch optimizations.

Well, perhaps this *p++=*q++ is part of the result of such a process,
where the target happens to be C source code. Few languages higher level
than ASM are suited for that job.

But by all means continue to pour scorn on it.

Re: Dereference relative to increment and decrement operators ++ --

<tkrm8q$1hee4$3@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: james.harris.1@gmail.com (James Harris)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Sun, 13 Nov 2022 21:06:34 +0000
Organization: A noiseless patient Spider
Lines: 75
Message-ID: <tkrm8q$1hee4$3@dont-email.me>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkbf52$3kmic$1@dont-email.me> <tkbgnf$1nd8$1@gioia.aioe.org>
<tkd2j6$3s35k$1@dont-email.me> <tkd3lv$1g9o$1@gioia.aioe.org>
<tkrftl$1gtkg$4@dont-email.me> <tkrjfu$757$1@gioia.aioe.org>
<tkrl85$113l$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 13 Nov 2022 21:06:34 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="45c540c812ba7e7a9f8aaaa580905047";
logging-data="1620420"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/TtSGFUawgRGT6tKWWX+C39SKuVTYCRlg="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:nNuwmJk/GHrVYFzxb5nqSVbub5E=
Content-Language: en-GB
In-Reply-To: <tkrl85$113l$1@gioia.aioe.org>
 by: James Harris - Sun, 13 Nov 2022 21:06 UTC

On 13/11/2022 20:49, Bart wrote:
> On 13/11/2022 20:19, Dmitry A. Kazakov wrote:
>> On 2022-11-13 20:18, James Harris wrote:
>>> On 08/11/2022 08:23, Dmitry A. Kazakov wrote:
>>>> On 2022-11-08 09:04, James Harris wrote:
>>>>
>>>>> I like the simplicity of the language which would result from your
>>>>> suggestions but can't help but think they would make programming in
>>>>> it less comfortable, like the simplicity of a hair shirt. ;)
>>>>
>>>> If you think programmers are dying to write stuff like *p++=*q++;
>>>> you are wrong. Actually that train left the station. Today C++ fun
>>>> is templates. It is monstrous instantiations over instantiations
>>>> barely resembling program code. Modern times is a glorious
>>>> combination of Python performance with K&R C readability! (:-))
>>>
>>> Contrast
>>>
>>>    *p := *q
>>>    p := p + 1
>>>    q := q + 1
>>>
>>> Perhaps
>>>
>>>    +p++ := *q++
>>>
>>> expresses that part of the algorithm in a way which is more natural
>>> and easier to read...?
>>
>> No algorithm requires you resort to pointers.

This doesn't have to be about pointers, Dmitry. One could just as easily
have

a[i++] := b[j++]

>> With arrays it is plain
>> assignment:
>>
>>     p := q;
>
> You're assuming this is part of a loop. But perhaps other things are
> happening after each *p++ = *q++: the next source or dest might be
> different, or the next transfer might be of a different type and/or size.

Yes, and less than a whole array may be being copied, or part of an
array may be being copied over another part of the same array, etc.

>
> This is what makes such lower level operations so useful. A solution in
> a higher level but more limiting language might require ingenuity to get
> around the strictness.
>
>> which BTW could be performed in parallel or by a single instruction on
>> a CISC machine or with a bunch optimizations.
>
> Well, perhaps this *p++=*q++ is part of the result of such a process,
> where the target happens to be C source code. Few languages higher level
> than ASM are suited for that job.

Compilers are getting good at recognising code which can be turned into
intrinsics, though IMO we shouldn't ask too much of them.

For example, an entire loop to count the bits set in a word may be
recognised by a compiler and on an x86 target turned into a single
popcnt instruction but AISI it would be better for the language to
supply pseudofunctions for operations such as that. Why? Primarily
because they make the source code easier to read.

--
James Harris

Re: Dereference relative to increment and decrement operators ++ --

<tkrmnj$1jbk$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!aioe.org!pMM5B9Rl/1LQCd+Nt14ETA.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Sun, 13 Nov 2022 22:14:28 +0100
Organization: Aioe.org NNTP Server
Message-ID: <tkrmnj$1jbk$1@gioia.aioe.org>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkbf52$3kmic$1@dont-email.me> <tkbgnf$1nd8$1@gioia.aioe.org>
<tkd2j6$3s35k$1@dont-email.me> <tkd3lv$1g9o$1@gioia.aioe.org>
<tkrftl$1gtkg$4@dont-email.me> <tkrjfu$757$1@gioia.aioe.org>
<tkrl85$113l$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="52596"; posting-host="pMM5B9Rl/1LQCd+Nt14ETA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Sun, 13 Nov 2022 21:14 UTC

On 2022-11-13 21:49, Bart wrote:
> On 13/11/2022 20:19, Dmitry A. Kazakov wrote:
>> On 2022-11-13 20:18, James Harris wrote:
>>> On 08/11/2022 08:23, Dmitry A. Kazakov wrote:
>>>> On 2022-11-08 09:04, James Harris wrote:
>>>>
>>>>> I like the simplicity of the language which would result from your
>>>>> suggestions but can't help but think they would make programming in
>>>>> it less comfortable, like the simplicity of a hair shirt. ;)
>>>>
>>>> If you think programmers are dying to write stuff like *p++=*q++;
>>>> you are wrong. Actually that train left the station. Today C++ fun
>>>> is templates. It is monstrous instantiations over instantiations
>>>> barely resembling program code. Modern times is a glorious
>>>> combination of Python performance with K&R C readability! (:-))
>>>
>>> Contrast
>>>
>>>    *p := *q
>>>    p := p + 1
>>>    q := q + 1
>>>
>>> Perhaps
>>>
>>>    +p++ := *q++
>>>
>>> expresses that part of the algorithm in a way which is more natural
>>> and easier to read...?
>>
>> No algorithm requires you resort to pointers. With arrays it is plain
>> assignment:
>>
>>     p := q;
>
> You're assuming this is part of a loop. But perhaps other things are
> happening after each *p++ = *q++: the next source or dest might be
> different, or the next transfer might be of a different type and/or size.
>
> This is what makes such lower level operations so useful. A solution in
> a higher level but more limiting language might require ingenuity to get
> around the strictness.
>
>> which BTW could be performed in parallel or by a single instruction on
>> a CISC machine or with a bunch optimizations.
>
> Well, perhaps this *p++=*q++ is part of the result of such a process,
> where the target happens to be C source code. Few languages higher level
> than ASM are suited for that job.
>
> But by all means continue to pour scorn on it.

Sure, the point was about algorithms. Some artificially constructed
cases do not count for programmers. This is why there is no need in such
low-level languages. If something falls out of effective and safe
techniques, the program gets redesigned.

It is called engineering. If you have to design a new type of screw for
your project, you are a bad engineer.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Dereference relative to increment and decrement operators ++ --

<tkrnj7$2g9$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!aioe.org!pMM5B9Rl/1LQCd+Nt14ETA.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Sun, 13 Nov 2022 22:29:13 +0100
Organization: Aioe.org NNTP Server
Message-ID: <tkrnj7$2g9$1@gioia.aioe.org>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkbf52$3kmic$1@dont-email.me> <tkbgnf$1nd8$1@gioia.aioe.org>
<tkd2j6$3s35k$1@dont-email.me> <tkd3lv$1g9o$1@gioia.aioe.org>
<tkrftl$1gtkg$4@dont-email.me> <tkrjfu$757$1@gioia.aioe.org>
<tkrl85$113l$1@gioia.aioe.org> <tkrm8q$1hee4$3@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="2569"; posting-host="pMM5B9Rl/1LQCd+Nt14ETA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Sun, 13 Nov 2022 21:29 UTC

On 2022-11-13 22:06, James Harris wrote:
> On 13/11/2022 20:49, Bart wrote:
>> On 13/11/2022 20:19, Dmitry A. Kazakov wrote:
>>> On 2022-11-13 20:18, James Harris wrote:
>>>> On 08/11/2022 08:23, Dmitry A. Kazakov wrote:
>>>>> On 2022-11-08 09:04, James Harris wrote:
>>>>>
>>>>>> I like the simplicity of the language which would result from your
>>>>>> suggestions but can't help but think they would make programming
>>>>>> in it less comfortable, like the simplicity of a hair shirt. ;)
>>>>>
>>>>> If you think programmers are dying to write stuff like *p++=*q++;
>>>>> you are wrong. Actually that train left the station. Today C++ fun
>>>>> is templates. It is monstrous instantiations over instantiations
>>>>> barely resembling program code. Modern times is a glorious
>>>>> combination of Python performance with K&R C readability! (:-))
>>>>
>>>> Contrast
>>>>
>>>>    *p := *q
>>>>    p := p + 1
>>>>    q := q + 1
>>>>
>>>> Perhaps
>>>>
>>>>    +p++ := *q++
>>>>
>>>> expresses that part of the algorithm in a way which is more natural
>>>> and easier to read...?
>>>
>>> No algorithm requires you resort to pointers.
>
> This doesn't have to be about pointers, Dmitry. One could just as easily
> have
>
>   a[i++] := b[j++]

Same question. What for?

Why not a[i expexp(Pi) sqrtsqrt] := b[j!!]. Where are post square root,
post exponentiation, post factorial when the humankind need them so bad?

You remind be a salesman selling the toaster equipped with a toilet
brush. Know what? I do not need this combination...

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Dereference relative to increment and decrement operators ++ --

<tkrq1f$1hee4$5@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: james.harris.1@gmail.com (James Harris)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Sun, 13 Nov 2022 22:10:55 +0000
Organization: A noiseless patient Spider
Lines: 60
Message-ID: <tkrq1f$1hee4$5@dont-email.me>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkbf52$3kmic$1@dont-email.me> <tkbgnf$1nd8$1@gioia.aioe.org>
<tkd2j6$3s35k$1@dont-email.me> <tkd3lv$1g9o$1@gioia.aioe.org>
<tkrftl$1gtkg$4@dont-email.me> <tkrjfu$757$1@gioia.aioe.org>
<tkrl85$113l$1@gioia.aioe.org> <tkrm8q$1hee4$3@dont-email.me>
<tkrnj7$2g9$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 13 Nov 2022 22:10:56 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="45c540c812ba7e7a9f8aaaa580905047";
logging-data="1620420"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/mAjGQbQUKd6y/fwBHKP6LojC5Bvyod0Q="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:GGGUcfvAmNxoATxdHL8GAzRGl/E=
Content-Language: en-GB
In-Reply-To: <tkrnj7$2g9$1@gioia.aioe.org>
 by: James Harris - Sun, 13 Nov 2022 22:10 UTC

On 13/11/2022 21:29, Dmitry A. Kazakov wrote:
> On 2022-11-13 22:06, James Harris wrote:
>> On 13/11/2022 20:49, Bart wrote:
>>> On 13/11/2022 20:19, Dmitry A. Kazakov wrote:
>>>> On 2022-11-13 20:18, James Harris wrote:
>>>>> On 08/11/2022 08:23, Dmitry A. Kazakov wrote:
>>>>>> On 2022-11-08 09:04, James Harris wrote:
>>>>>>
>>>>>>> I like the simplicity of the language which would result from
>>>>>>> your suggestions but can't help but think they would make
>>>>>>> programming in it less comfortable, like the simplicity of a hair
>>>>>>> shirt. ;)
>>>>>>
>>>>>> If you think programmers are dying to write stuff like *p++=*q++;
>>>>>> you are wrong. Actually that train left the station. Today C++ fun
>>>>>> is templates. It is monstrous instantiations over instantiations
>>>>>> barely resembling program code. Modern times is a glorious
>>>>>> combination of Python performance with K&R C readability! (:-))
>>>>>
>>>>> Contrast
>>>>>
>>>>>    *p := *q
>>>>>    p := p + 1
>>>>>    q := q + 1
>>>>>
>>>>> Perhaps
>>>>>
>>>>>    +p++ := *q++
>>>>>
>>>>> expresses that part of the algorithm in a way which is more natural
>>>>> and easier to read...?
>>>>
>>>> No algorithm requires you resort to pointers.
>>
>> This doesn't have to be about pointers, Dmitry. One could just as
>> easily have
>>
>>    a[i++] := b[j++]
>
> Same question. What for?

What do you mean, "What for?"?

>
> Why not a[i expexp(Pi) sqrtsqrt] := b[j!!]. Where are post square root,
> post exponentiation, post factorial when the humankind need them so bad?

I cannot tell what point you are trying to make.

>
> You remind be a salesman selling the toaster equipped with a toilet
> brush. Know what? I do not need this combination...

I think you only need the toilet brush.

--
James Harris

Re: Dereference relative to increment and decrement operators ++ --

<tks4j3$fqd$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!aioe.org!uabYU4OOdxBKlV2hpj27FQ.user.46.165.242.75.POSTED!not-for-mail
From: bc@freeuk.com (Bart)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Mon, 14 Nov 2022 01:10:59 +0000
Organization: Aioe.org NNTP Server
Message-ID: <tks4j3$fqd$1@gioia.aioe.org>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkbf52$3kmic$1@dont-email.me> <tkbgnf$1nd8$1@gioia.aioe.org>
<tkd2j6$3s35k$1@dont-email.me> <tkd3lv$1g9o$1@gioia.aioe.org>
<tkrftl$1gtkg$4@dont-email.me> <tkrjfu$757$1@gioia.aioe.org>
<tkrl85$113l$1@gioia.aioe.org> <tkrm8q$1hee4$3@dont-email.me>
<tkrnj7$2g9$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="16205"; posting-host="uabYU4OOdxBKlV2hpj27FQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
X-Notice: Filtered by postfilter v. 0.9.2
 by: Bart - Mon, 14 Nov 2022 01:10 UTC

On 13/11/2022 21:29, Dmitry A. Kazakov wrote:
> On 2022-11-13 22:06, James Harris wrote:
>> On 13/11/2022 20:49, Bart wrote:
>>> On 13/11/2022 20:19, Dmitry A. Kazakov wrote:
>>>> On 2022-11-13 20:18, James Harris wrote:
>>>>> On 08/11/2022 08:23, Dmitry A. Kazakov wrote:
>>>>>> On 2022-11-08 09:04, James Harris wrote:
>>>>>>
>>>>>>> I like the simplicity of the language which would result from
>>>>>>> your suggestions but can't help but think they would make
>>>>>>> programming in it less comfortable, like the simplicity of a hair
>>>>>>> shirt. ;)
>>>>>>
>>>>>> If you think programmers are dying to write stuff like *p++=*q++;
>>>>>> you are wrong. Actually that train left the station. Today C++ fun
>>>>>> is templates. It is monstrous instantiations over instantiations
>>>>>> barely resembling program code. Modern times is a glorious
>>>>>> combination of Python performance with K&R C readability! (:-))
>>>>>
>>>>> Contrast
>>>>>
>>>>>    *p := *q
>>>>>    p := p + 1
>>>>>    q := q + 1
>>>>>
>>>>> Perhaps
>>>>>
>>>>>    +p++ := *q++
>>>>>
>>>>> expresses that part of the algorithm in a way which is more natural
>>>>> and easier to read...?
>>>>
>>>> No algorithm requires you resort to pointers.
>>
>> This doesn't have to be about pointers, Dmitry. One could just as
>> easily have
>>
>>    a[i++] := b[j++]
>
> Same question. What for?
>
> Why not a[i expexp(Pi) sqrtsqrt] := b[j!!]. Where are post square root,
> post exponentiation, post factorial when the humankind need them so bad?
>
> You remind be a salesman selling the toaster equipped with a toilet
> brush. Know what? I do not need this combination...

But I do!

My largest program uses ++ nearly 1000 times (all varieties).

It would use expexp, sqrtsqrt or !! exactly zero times each. So it would
be very poor language design, and pointless.

There is also no prior art; noone would have a clue what it meant.
Neither do I; I think your sqrtsqrt means:

(t:=x; x:=sqrt(x); t)

But this is easy enough to implement within usercode; it doesn't need a
dedicated language feature, as it's not something that a decent
percentage of a language's community would commonly use.

Re: Dereference relative to increment and decrement operators ++ --

<tkss3l$184b$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!aioe.org!pMM5B9Rl/1LQCd+Nt14ETA.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Mon, 14 Nov 2022 08:52:21 +0100
Organization: Aioe.org NNTP Server
Message-ID: <tkss3l$184b$1@gioia.aioe.org>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkbf52$3kmic$1@dont-email.me> <tkbgnf$1nd8$1@gioia.aioe.org>
<tkd2j6$3s35k$1@dont-email.me> <tkd3lv$1g9o$1@gioia.aioe.org>
<tkrftl$1gtkg$4@dont-email.me> <tkrjfu$757$1@gioia.aioe.org>
<tkrl85$113l$1@gioia.aioe.org> <tkrm8q$1hee4$3@dont-email.me>
<tkrnj7$2g9$1@gioia.aioe.org> <tkrq1f$1hee4$5@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="41099"; posting-host="pMM5B9Rl/1LQCd+Nt14ETA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.1
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Mon, 14 Nov 2022 07:52 UTC

On 2022-11-13 23:10, James Harris wrote:
> On 13/11/2022 21:29, Dmitry A. Kazakov wrote:
>> On 2022-11-13 22:06, James Harris wrote:
>>> On 13/11/2022 20:49, Bart wrote:
>>>> On 13/11/2022 20:19, Dmitry A. Kazakov wrote:
>>>>> On 2022-11-13 20:18, James Harris wrote:
>>>>>> On 08/11/2022 08:23, Dmitry A. Kazakov wrote:
>>>>>>> On 2022-11-08 09:04, James Harris wrote:
>>>>>>>
>>>>>>>> I like the simplicity of the language which would result from
>>>>>>>> your suggestions but can't help but think they would make
>>>>>>>> programming in it less comfortable, like the simplicity of a
>>>>>>>> hair shirt. ;)
>>>>>>>
>>>>>>> If you think programmers are dying to write stuff like *p++=*q++;
>>>>>>> you are wrong. Actually that train left the station. Today C++
>>>>>>> fun is templates. It is monstrous instantiations over
>>>>>>> instantiations barely resembling program code. Modern times is a
>>>>>>> glorious combination of Python performance with K&R C
>>>>>>> readability! (:-))
>>>>>>
>>>>>> Contrast
>>>>>>
>>>>>>    *p := *q
>>>>>>    p := p + 1
>>>>>>    q := q + 1
>>>>>>
>>>>>> Perhaps
>>>>>>
>>>>>>    +p++ := *q++
>>>>>>
>>>>>> expresses that part of the algorithm in a way which is more
>>>>>> natural and easier to read...?
>>>>>
>>>>> No algorithm requires you resort to pointers.
>>>
>>> This doesn't have to be about pointers, Dmitry. One could just as
>>> easily have
>>>
>>>    a[i++] := b[j++]
>>
>> Same question. What for?
>
> What do you mean, "What for?"?

Show me the algorithm.
>> Why not a[i expexp(Pi) sqrtsqrt] := b[j!!]. Where are post square
>> root, post exponentiation, post factorial when the humankind need them
>> so bad?
>
> I cannot tell what point you are trying to make.

There exist an infinite number of combinations that could be operators.
E.g. divide by two and reboot the computer.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Dereference relative to increment and decrement operators ++ --

<tkt1kn$1nnqe$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Mon, 14 Nov 2022 10:26:46 +0100
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <tkt1kn$1nnqe$1@dont-email.me>
References: <tkarnt$3ivof$1@dont-email.me> <tkb6ej$3ju6l$1@dont-email.me>
<tkb7st$124k$1@gioia.aioe.org> <tkbc1r$3keqj$1@dont-email.me>
<tkdlac$3tnip$3@dont-email.me> <tke05u$3unsq$1@dont-email.me>
<tkr8gh$1g8fs$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 14 Nov 2022 09:26:47 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="8cf3dad3d17addf139cb048320096eae";
logging-data="1826638"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX190nh/tfI8QT8262ErnpKuQdO1BWxr9Khs="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:DZSZiJzhDeymCtG7AvvLGF8t880=
Content-Language: en-GB
In-Reply-To: <tkr8gh$1g8fs$2@dont-email.me>
 by: David Brown - Mon, 14 Nov 2022 09:26 UTC

On 13/11/2022 18:11, James Harris wrote:
> On 08/11/2022 16:29, David Brown wrote:
>> On 08/11/2022 14:24, James Harris wrote:
>
> ...
>
>> You can't stop everything - those evil programmers have better
>> imaginations than any well-meaning language designer.  But you can
>> try.   Aim to make it harder to write convoluted code, and easier to
>> write clearer code.  And try to make the clearer code more efficient,
>> to reduce the temptation to write evil code.
>
> I agree
>
> ...
>
>>> In a similar way, programming can be hard when other programmers
>>> write constructs we don't like. I agree that it's best for a language
>>> to help programmers write readable and comprehensible programs - and
>>> even to make them the easiest to write, if possible - but the very
>>> flexibility which may allow them to do so may also give then the
>>> freedom to write code we don't care for. I don't think one can
>>> legislate against that.
>>>
>>
>> I'm not sure it is the same - after all, if some one exercises their
>> rights to speak gibberish, or to give long, convoluted and
>> incomprehensible speaches, the listener has the right to go away,
>> ignore them, or fall asleep.  It's harder for a compiler to do that!
>
> I'm not worried about the compiler. As long as it can make sense of a
> piece of code then it can compile it. It's the human I am concerned
> about, especially the poor old maintenance programmer!
>

You /say/ that, but you don't appear to believe it or be interested in
making it happen.

On the one side, you claim you want a clear language that is
understandable for programmers and maintenance. On the other side, you
want to decide what "++E++" should mean, with random "^" characters
thrown in for good measure.

These two statements go together as well as Dmitry's toaster and toilet
brush. It doesn't matter how precisely you define how the combination
can be used and what it does, it is still not a good or useful thing.

Re: Dereference relative to increment and decrement operators ++ --

<tkt4hd$1npeq$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: james.harris.1@gmail.com (James Harris)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Mon, 14 Nov 2022 10:16:13 +0000
Organization: A noiseless patient Spider
Lines: 70
Message-ID: <tkt4hd$1npeq$1@dont-email.me>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkbf52$3kmic$1@dont-email.me> <tkbgnf$1nd8$1@gioia.aioe.org>
<tkd2j6$3s35k$1@dont-email.me> <tkd3lv$1g9o$1@gioia.aioe.org>
<tkrftl$1gtkg$4@dont-email.me> <tkrjfu$757$1@gioia.aioe.org>
<tkrl85$113l$1@gioia.aioe.org> <tkrm8q$1hee4$3@dont-email.me>
<tkrnj7$2g9$1@gioia.aioe.org> <tkrq1f$1hee4$5@dont-email.me>
<tkss3l$184b$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 14 Nov 2022 10:16:13 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="8263756e12ee8e930e244e2401ed7b00";
logging-data="1828314"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+GMLBlqAlWksB8izTCMlYKGFZMUh7p7F0="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:69SSdQJ5nfXAMjv97UEyzCWKZa0=
In-Reply-To: <tkss3l$184b$1@gioia.aioe.org>
Content-Language: en-GB
 by: James Harris - Mon, 14 Nov 2022 10:16 UTC

On 14/11/2022 07:52, Dmitry A. Kazakov wrote:
> On 2022-11-13 23:10, James Harris wrote:
>> On 13/11/2022 21:29, Dmitry A. Kazakov wrote:
>>> On 2022-11-13 22:06, James Harris wrote:
>>>> On 13/11/2022 20:49, Bart wrote:
>>>>> On 13/11/2022 20:19, Dmitry A. Kazakov wrote:
>>>>>> On 2022-11-13 20:18, James Harris wrote:

....

>>>>>>> Contrast
>>>>>>>
>>>>>>>    *p := *q
>>>>>>>    p := p + 1
>>>>>>>    q := q + 1
>>>>>>>
>>>>>>> Perhaps
>>>>>>>
>>>>>>>    +p++ := *q++
>>>>>>>
>>>>>>> expresses that part of the algorithm in a way which is more
>>>>>>> natural and easier to read...?
>>>>>>
>>>>>> No algorithm requires you resort to pointers.
>>>>
>>>> This doesn't have to be about pointers, Dmitry. One could just as
>>>> easily have
>>>>
>>>>    a[i++] := b[j++]
>>>
>>> Same question. What for?
>>
>> What do you mean, "What for?"?
>
> Show me the algorithm.

There's no particular algorithm; the construct is a potential component
of many algorithms. It's as though someone points out a brick and
someone else says "what does it mean?" or "show me the house that would
be built from it before I can judge whether a brick is a good idea or
not". It's a potential component, nothing more.

>>> Why not a[i expexp(Pi) sqrtsqrt] := b[j!!]. Where are post square
>>> root, post exponentiation, post factorial when the humankind need
>>> them so bad?
>>
>> I cannot tell what point you are trying to make.
>
> There exist an infinite number of combinations that could be operators.
> E.g. divide by two and reboot the computer.

OK. ATM I have a generous **but limited** number of operators. For
anything else the programmer would have to call a function. For example,
I mentioned here recently that some compilers are extensive enough that
they can recognise a loop which counts the number of bits set in a word.
I would not have that as an operator but as a function (or
pseudofunction). It might be invoked on c as

x := a + b + bitcount(c) + d

Again, IMO it's important for the language to provide such
pseudofunctions so that a programmer's code can be made clearer,
simpler, and more readable.

--
James Harris

Re: Dereference relative to increment and decrement operators ++ --

<Python-20221114112350@ram.dialup.fu-berlin.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: 14 Nov 2022 10:24:18 GMT
Organization: Stefan Ram
Lines: 23
Expires: 1 Sep 2023 11:59:58 GMT
Message-ID: <Python-20221114112350@ram.dialup.fu-berlin.de>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org> <tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org> <tkb6ud$i6r$1@gioia.aioe.org> <tkbb1n$muh$1@gioia.aioe.org> <tkr3v0$1frm6$2@dont-email.me> <tkr5qt$1r7b$1@gioia.aioe.org> <tkrfk0$1gtkg$3@dont-email.me> <Unicode-20221113202832@ram.dialup.fu-berlin.de> <tkrieu$1h3es$3@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de n74ZpMESIYhlohwDwayJEQ0/hvNy5834LqIYXRP5btI57a
X-Copyright: (C) Copyright 2022 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Mon, 14 Nov 2022 10:24 UTC

James Harris <james.harris.1@gmail.com> writes:
>Rather than allowing non-ASCII in source I came up with a scheme of what
>you might call 'named characters' extending the backslash idea of C to
>allow names instead of single characters after the backslash. It's off
>topic for this thread but it allows non-ASCII characters to be named
>(such that the names consist of ASCII characters and would thus be
>readable and universal).

Here's an example of a Python program.

print( "\N{REVERSE SOLIDUS}\N{QUOTATION MARK}" )

It prints:

\"

. But in Python one could also write

print( r'\"' )

to get the same output.

Re: Dereference relative to increment and decrement operators ++ --

<tkt5gd$1ce8$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!aioe.org!pMM5B9Rl/1LQCd+Nt14ETA.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Mon, 14 Nov 2022 11:32:46 +0100
Organization: Aioe.org NNTP Server
Message-ID: <tkt5gd$1ce8$1@gioia.aioe.org>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkbf52$3kmic$1@dont-email.me> <tkbgnf$1nd8$1@gioia.aioe.org>
<tkd2j6$3s35k$1@dont-email.me> <tkd3lv$1g9o$1@gioia.aioe.org>
<tkrftl$1gtkg$4@dont-email.me> <tkrjfu$757$1@gioia.aioe.org>
<tkrl85$113l$1@gioia.aioe.org> <tkrm8q$1hee4$3@dont-email.me>
<tkrnj7$2g9$1@gioia.aioe.org> <tkrq1f$1hee4$5@dont-email.me>
<tkss3l$184b$1@gioia.aioe.org> <tkt4hd$1npeq$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="45512"; posting-host="pMM5B9Rl/1LQCd+Nt14ETA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.1
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Mon, 14 Nov 2022 10:32 UTC

On 2022-11-14 11:16, James Harris wrote:
> On 14/11/2022 07:52, Dmitry A. Kazakov wrote:
>> On 2022-11-13 23:10, James Harris wrote:
>>> On 13/11/2022 21:29, Dmitry A. Kazakov wrote:
>>>> On 2022-11-13 22:06, James Harris wrote:
>>>>> On 13/11/2022 20:49, Bart wrote:
>>>>>> On 13/11/2022 20:19, Dmitry A. Kazakov wrote:
>>>>>>> On 2022-11-13 20:18, James Harris wrote:
>
> ...
>
>>>>>>>> Contrast
>>>>>>>>
>>>>>>>>    *p := *q
>>>>>>>>    p := p + 1
>>>>>>>>    q := q + 1
>>>>>>>>
>>>>>>>> Perhaps
>>>>>>>>
>>>>>>>>    +p++ := *q++
>>>>>>>>
>>>>>>>> expresses that part of the algorithm in a way which is more
>>>>>>>> natural and easier to read...?
>>>>>>>
>>>>>>> No algorithm requires you resort to pointers.
>>>>>
>>>>> This doesn't have to be about pointers, Dmitry. One could just as
>>>>> easily have
>>>>>
>>>>>    a[i++] := b[j++]
>>>>
>>>> Same question. What for?
>>>
>>> What do you mean, "What for?"?
>>
>> Show me the algorithm.
>
> There's no particular algorithm; the construct is a potential component
> of many algorithms.

Show me one that is not array assignment.

> It's as though someone points out a brick and
> someone else says "what does it mean?"

No, it is like building up a brick factory in your back garden for the
purpose of cracking walnuts...

>>>> Why not a[i expexp(Pi) sqrtsqrt] := b[j!!]. Where are post square
>>>> root, post exponentiation, post factorial when the humankind need
>>>> them so bad?
>>>
>>> I cannot tell what point you are trying to make.
>>
>> There exist an infinite number of combinations that could be
>> operators. E.g. divide by two and reboot the computer.
>
> OK. ATM I have a generous **but limited** number of operators.

Limited by which criteria?

> Again, IMO it's important for the language to provide such
> pseudofunctions so that a programmer's code can be made clearer,
> simpler, and more readable.

Like this one?

++p+++

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Dereference relative to increment and decrement operators ++ --

<tkt65s$1o3kc$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: james.harris.1@gmail.com (James Harris)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Mon, 14 Nov 2022 10:44:12 +0000
Organization: A noiseless patient Spider
Lines: 72
Message-ID: <tkt65s$1o3kc$1@dont-email.me>
References: <tkarnt$3ivof$1@dont-email.me> <tkb6ej$3ju6l$1@dont-email.me>
<tkb7st$124k$1@gioia.aioe.org> <tkbc1r$3keqj$1@dont-email.me>
<tkdlac$3tnip$3@dont-email.me> <tke05u$3unsq$1@dont-email.me>
<tkr8gh$1g8fs$2@dont-email.me> <tkt1kn$1nnqe$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 14 Nov 2022 10:44:12 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="8263756e12ee8e930e244e2401ed7b00";
logging-data="1838732"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/igosnMcKnUccq9Gp/oEuTFSi+MO7BO6o="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:q64kaqXq0eRsF1WlIsuVtkpOKhc=
Content-Language: en-GB
In-Reply-To: <tkt1kn$1nnqe$1@dont-email.me>
 by: James Harris - Mon, 14 Nov 2022 10:44 UTC

On 14/11/2022 09:26, David Brown wrote:
> On 13/11/2022 18:11, James Harris wrote:
>> On 08/11/2022 16:29, David Brown wrote:
>>
>> ...
>>
>>> You can't stop everything - those evil programmers have better
>>> imaginations than any well-meaning language designer.  But you can
>>> try.   Aim to make it harder to write convoluted code, and easier to
>>> write clearer code.  And try to make the clearer code more efficient,
>>> to reduce the temptation to write evil code.
>>
>> I agree

....

>> I'm not worried about the compiler. As long as it can make sense of a
>> piece of code then it can compile it. It's the human I am concerned
>> about, especially the poor old maintenance programmer!
>>
>
> You /say/ that, but you don't appear to believe it or be interested in
> making it happen.

That comment surprises me a little. /The main point/ of this, AISI, is
to make the job of the programmer simpler and to help him write code
which is more readable. You said yourself that (paraphrasing) when
there's a choice between clear and convoluted code it's important for a
language to make the clearer code the easier one to write.

>
> On the one side, you claim you want a clear language that is
> understandable for programmers and maintenance.

Yes.

> On the other side, you
> want to decide what "++E++" should mean, with random "^" characters
> thrown in for good measure.

Not quite. As language designer I have to decide what facilities will be
provided but I do not have absolute control over what a programmer may
do with the facilities. Nor would a programmer want to work with a
language which implemented unnecessary rules or rules which he may see
as arbitrary.

The expression you mention is just one of a myriad of what you might
consider to be potential nasties. If I am going to prohibit that one
then what about all the others?

>
> These two statements go together as well as Dmitry's toaster and toilet
> brush.  It doesn't matter how precisely you define how the combination
> can be used and what it does, it is still not a good or useful thing.

OK, let's take the combination you mentioned:

++E++

I wonder why you see a problem with it. As I see it, it increments E
before evaluation and then increments E after evaluation. What is so
complex about that? It does exactly what it says on the tin, and in the
order that it says it. Remember that unlike C I define the apparent
order of evaluation so the expression is perfectly well formed.

--
James Harris

Re: Dereference relative to increment and decrement operators ++ --

<tkt6c1$1pso$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!aioe.org!uabYU4OOdxBKlV2hpj27FQ.user.46.165.242.75.POSTED!not-for-mail
From: bc@freeuk.com (Bart)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Mon, 14 Nov 2022 10:47:29 +0000
Organization: Aioe.org NNTP Server
Message-ID: <tkt6c1$1pso$1@gioia.aioe.org>
References: <tkarnt$3ivof$1@dont-email.me> <tkb6ej$3ju6l$1@dont-email.me>
<tkb7st$124k$1@gioia.aioe.org> <tkbc1r$3keqj$1@dont-email.me>
<tkdlac$3tnip$3@dont-email.me> <tke05u$3unsq$1@dont-email.me>
<tkr8gh$1g8fs$2@dont-email.me> <tkt1kn$1nnqe$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="59288"; posting-host="uabYU4OOdxBKlV2hpj27FQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
X-Notice: Filtered by postfilter v. 0.9.2
 by: Bart - Mon, 14 Nov 2022 10:47 UTC

On 14/11/2022 09:26, David Brown wrote:
> On 13/11/2022 18:11, James Harris wrote:
>> On 08/11/2022 16:29, David Brown wrote:

>> I'm not worried about the compiler. As long as it can make sense of a
>> piece of code then it can compile it. It's the human I am concerned
>> about, especially the poor old maintenance programmer!
>>
>
> You /say/ that, but you don't appear to believe it or be interested in
> making it happen.
>
> On the one side, you claim you want a clear language that is
> understandable for programmers and maintenance.  On the other side, you
> want to decide what "++E++" should mean, with random "^" characters
> thrown in for good measure.

In-place, value-returning increment ops written as ++ and -- are common
in languages.

So are pointer-dereference operators in lower-level languages, whether
written as * or ^.

Once you have those two possibilities in a language, why shouldn't you
define what combinations of those operators might mean?

(I just differ from James in thinking that successive *value-returning**
++ or -- operators, whether prefix or postfix, are not meaningful. I'd
also think it would be bad form to chain them, but it is not practical
to be ban at the syntax level.

However, I have sometimes banned even `a+b` in some contexts, when the
resulting value is unused.)

Is your point that you shouldn't have either of those operators? ++ and
-- can be replaced at some inconvenience. But getting rid of dereference
is harder; if P is a pointer:

print P

will this display the value of the pointer, or the value of its target?
If only there was a way to specify that precisely!

Note that when p and q are byte pointers, then *p++ = *q++ (or p++^ :=
q++^) corresponds to the one-byte Z80 LDI instruction.

So it's something so meaningless that that tiny 8-bit processor decided
to give it its own instruction.

Re: Dereference relative to increment and decrement operators ++ --

<tkt73i$4vo$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!aioe.org!uabYU4OOdxBKlV2hpj27FQ.user.46.165.242.75.POSTED!not-for-mail
From: bc@freeuk.com (Bart)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Mon, 14 Nov 2022 11:00:02 +0000
Organization: Aioe.org NNTP Server
Message-ID: <tkt73i$4vo$1@gioia.aioe.org>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkbf52$3kmic$1@dont-email.me> <tkbgnf$1nd8$1@gioia.aioe.org>
<tkd2j6$3s35k$1@dont-email.me> <tkd3lv$1g9o$1@gioia.aioe.org>
<tkrftl$1gtkg$4@dont-email.me> <tkrjfu$757$1@gioia.aioe.org>
<tkrl85$113l$1@gioia.aioe.org> <tkrm8q$1hee4$3@dont-email.me>
<tkrnj7$2g9$1@gioia.aioe.org> <tkrq1f$1hee4$5@dont-email.me>
<tkss3l$184b$1@gioia.aioe.org> <tkt4hd$1npeq$1@dont-email.me>
<tkt5gd$1ce8$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="5112"; posting-host="uabYU4OOdxBKlV2hpj27FQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
X-Notice: Filtered by postfilter v. 0.9.2
 by: Bart - Mon, 14 Nov 2022 11:00 UTC

On 14/11/2022 10:32, Dmitry A. Kazakov wrote:
> On 2022-11-14 11:16, James Harris wrote:

>>>>>>    a[i++] := b[j++]
>>>>>
>>>>> Same question. What for?
>>>>
>>>> What do you mean, "What for?"?
>>>
>>> Show me the algorithm.
>>
>> There's no particular algorithm; the construct is a potential
>> component of many algorithms.
>
> Show me one that is not array assignment.

What exactly is your objection: that there shouldn't be an increment
operator at all?

Then it's end of discussion. But if you allow a value-returning
increment operator, then someone could use it in multiple places in the
same expresion, together with other operators, and the language has to
be able to deal with it.

Note that any language that has reference parameters would allow this:

a[postincr(i)] := b[postincr(j)]

Or is that something else you're not keen on?

Re: Dereference relative to increment and decrement operators ++ --

<tkt7at$1o3kc$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: james.harris.1@gmail.com (James Harris)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Mon, 14 Nov 2022 11:03:57 +0000
Organization: A noiseless patient Spider
Lines: 102
Message-ID: <tkt7at$1o3kc$2@dont-email.me>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkbf52$3kmic$1@dont-email.me> <tkbgnf$1nd8$1@gioia.aioe.org>
<tkd2j6$3s35k$1@dont-email.me> <tkd3lv$1g9o$1@gioia.aioe.org>
<tkrftl$1gtkg$4@dont-email.me> <tkrjfu$757$1@gioia.aioe.org>
<tkrl85$113l$1@gioia.aioe.org> <tkrm8q$1hee4$3@dont-email.me>
<tkrnj7$2g9$1@gioia.aioe.org> <tkrq1f$1hee4$5@dont-email.me>
<tkss3l$184b$1@gioia.aioe.org> <tkt4hd$1npeq$1@dont-email.me>
<tkt5gd$1ce8$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 14 Nov 2022 11:03:58 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="8263756e12ee8e930e244e2401ed7b00";
logging-data="1838732"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18gxjcS1UIK1Yp4/Gi61hvKnVKH58dMvt4="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:sq94kHeNnShO049txKzRghD6998=
In-Reply-To: <tkt5gd$1ce8$1@gioia.aioe.org>
Content-Language: en-GB
 by: James Harris - Mon, 14 Nov 2022 11:03 UTC

On 14/11/2022 10:32, Dmitry A. Kazakov wrote:
> On 2022-11-14 11:16, James Harris wrote:
>> On 14/11/2022 07:52, Dmitry A. Kazakov wrote:
>>> On 2022-11-13 23:10, James Harris wrote:
>>>> On 13/11/2022 21:29, Dmitry A. Kazakov wrote:
>>>>> On 2022-11-13 22:06, James Harris wrote:
>>>>>> On 13/11/2022 20:49, Bart wrote:
>>>>>>> On 13/11/2022 20:19, Dmitry A. Kazakov wrote:
>>>>>>>> On 2022-11-13 20:18, James Harris wrote:
>>
>> ...
>>
>>>>>>>>> Contrast
>>>>>>>>>
>>>>>>>>>    *p := *q
>>>>>>>>>    p := p + 1
>>>>>>>>>    q := q + 1
>>>>>>>>>
>>>>>>>>> Perhaps
>>>>>>>>>
>>>>>>>>>    +p++ := *q++
>>>>>>>>>
>>>>>>>>> expresses that part of the algorithm in a way which is more
>>>>>>>>> natural and easier to read...?
>>>>>>>>
>>>>>>>> No algorithm requires you resort to pointers.
>>>>>>
>>>>>> This doesn't have to be about pointers, Dmitry. One could just as
>>>>>> easily have
>>>>>>
>>>>>>    a[i++] := b[j++]
>>>>>
>>>>> Same question. What for?
>>>>
>>>> What do you mean, "What for?"?
>>>
>>> Show me the algorithm.
>>
>> There's no particular algorithm; the construct is a potential
>> component of many algorithms.
>
> Show me one that is not array assignment.

if is_name_first(b[j])
a[i++] = b[j++]
rep while is_name_follow(b[j])
a[i++] = b[j++]
end rep
a[i] = 0
return TOK_NAME
end if

Now, what don't you like about the ++ operators in that? How would you
prefer to write it?

>
>> It's as though someone points out a brick and someone else says "what
>> does it mean?"
>
> No, it is like building up a brick factory in your back garden for the
> purpose of cracking walnuts...

Says the man who likes Ada! ;-)

>>>>> Why not a[i expexp(Pi) sqrtsqrt] := b[j!!]. Where are post square
>>>>> root, post exponentiation, post factorial when the humankind need
>>>>> them so bad?
>>>>
>>>> I cannot tell what point you are trying to make.
>>>
>>> There exist an infinite number of combinations that could be
>>> operators. E.g. divide by two and reboot the computer.
>>
>> OK. ATM I have a generous **but limited** number of operators.
>
> Limited by which criteria?

The set of operators is limited to what's reasonably necessary such as
the usual stuff: function calls, array references, field selection,
bitwise operations, arithmetic, comparison, boolean and assignment. Most
are present in C; only a few are not such as bitwise combinations (e.g.
nand and nor) and these two: concatenate and boolean (aka logical) xor.
What's so bad about that?

>
>> Again, IMO it's important for the language to provide such
>> pseudofunctions so that a programmer's code can be made clearer,
>> simpler, and more readable.
>
> Like this one?
>
>    ++p+++

I don't have a +++ operator so I am not sure what that is supposed to
mean. It's no valid in my language.

--
James Harris

Re: Dereference relative to increment and decrement operators ++ --

<tkt7ga$b0u$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!aioe.org!uabYU4OOdxBKlV2hpj27FQ.user.46.165.242.75.POSTED!not-for-mail
From: bc@freeuk.com (Bart)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Mon, 14 Nov 2022 11:06:50 +0000
Organization: Aioe.org NNTP Server
Message-ID: <tkt7ga$b0u$1@gioia.aioe.org>
References: <tkarnt$3ivof$1@dont-email.me> <tkb4d4$1795$1@gioia.aioe.org>
<tkbi2q$3kvvm$1@dont-email.me> <tke0tq$i1m$1@gioia.aioe.org>
<e45fd6ca-f079-4d01-a632-757cae19b570n@googlegroups.com>
<tkikjc$137g$1@gioia.aioe.org> <tkr7iv$1g8fs$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="11294"; posting-host="uabYU4OOdxBKlV2hpj27FQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
X-Notice: Filtered by postfilter v. 0.9.2
 by: Bart - Mon, 14 Nov 2022 11:06 UTC

On 13/11/2022 16:55, James Harris wrote:
> On 10/11/2022 10:42, Bart wrote:

>> It's clear that ++(A+B) can't work unless you change what ++ means
>> (eg. ++A now means (A+1) because whatever ++ modifies is not accessible).
>
> It's similar if A were a struct. You could have
>
>   A.F
>
> but you could not have
>
>   (A + 4).F
>
> The LHS of the . operation, in this case, has to be an lvalue.

That's not right. C allows functions to return structs; they are not
lvalues, but you can apply ".":

typedef struct{int x,y;}Point;

Point F(void) {
Point p;
return p;
}

int main(void)
{
Point p;
int a;

// F()=p; // Not valid: not an lvalue
a=F().x; // Valid
}

Re: Dereference relative to increment and decrement operators ++ --

<tkt7pt$frr$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!aioe.org!uabYU4OOdxBKlV2hpj27FQ.user.46.165.242.75.POSTED!not-for-mail
From: bc@freeuk.com (Bart)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Mon, 14 Nov 2022 11:11:57 +0000
Organization: Aioe.org NNTP Server
Message-ID: <tkt7pt$frr$1@gioia.aioe.org>
References: <tkarnt$3ivof$1@dont-email.me> <tkb6ej$3ju6l$1@dont-email.me>
<tkb7st$124k$1@gioia.aioe.org> <tkbc1r$3keqj$1@dont-email.me>
<tkdlac$3tnip$3@dont-email.me> <tke05u$3unsq$1@dont-email.me>
<tkr8gh$1g8fs$2@dont-email.me> <tkt1kn$1nnqe$1@dont-email.me>
<tkt65s$1o3kc$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="16251"; posting-host="uabYU4OOdxBKlV2hpj27FQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
X-Notice: Filtered by postfilter v. 0.9.2
 by: Bart - Mon, 14 Nov 2022 11:11 UTC

On 14/11/2022 10:44, James Harris wrote:
> On 14/11/2022 09:26, David Brown wrote:
>> On 13/11/2022 18:11, James Harris wrote:
>>> On 08/11/2022 16:29, David Brown wrote:
>>>
>>> ...
>>>
>>>> You can't stop everything - those evil programmers have better
>>>> imaginations than any well-meaning language designer.  But you can
>>>> try.   Aim to make it harder to write convoluted code, and easier to
>>>> write clearer code.  And try to make the clearer code more
>>>> efficient, to reduce the temptation to write evil code.
>>>
>>> I agree
>
> ...
>
>>> I'm not worried about the compiler. As long as it can make sense of a
>>> piece of code then it can compile it. It's the human I am concerned
>>> about, especially the poor old maintenance programmer!
>>>
>>
>> You /say/ that, but you don't appear to believe it or be interested in
>> making it happen.
>
> That comment surprises me a little. /The main point/ of this, AISI, is
> to make the job of the programmer simpler and to help him write code
> which is more readable. You said yourself that (paraphrasing) when
> there's a choice between clear and convoluted code it's important for a
> language to make the clearer code the easier one to write.
>
>>
>> On the one side, you claim you want a clear language that is
>> understandable for programmers and maintenance.
>
> Yes.
>
>
>> On the other side, you want to decide what "++E++" should mean, with
>> random "^" characters thrown in for good measure.
>
> Not quite. As language designer I have to decide what facilities will be
> provided but I do not have absolute control over what a programmer may
> do with the facilities. Nor would a programmer want to work with a
> language which implemented unnecessary rules or rules which he may see
> as arbitrary.
>
> The expression you mention is just one of a myriad of what you might
> consider to be potential nasties. If I am going to prohibit that one
> then what about all the others?
>
>
>>
>> These two statements go together as well as Dmitry's toaster and
>> toilet brush.  It doesn't matter how precisely you define how the
>> combination can be used and what it does, it is still not a good or
>> useful thing.
>
> OK, let's take the combination you mentioned:
>
>   ++E++
>
> I wonder why you see a problem with it. As I see it, it increments E
> before evaluation and then increments E after evaluation. What is so
> complex about that? It does exactly what it says on the tin, and in the
> order that it says it. Remember that unlike C I define the apparent
> order of evaluation so the expression is perfectly well formed.

But does this have the same priorities as:

op1 E op2

(where op2 is commonly done first) or does it have special rules, so
that in:

--E++

the -- is done first? If it's different, then what is the ordering when
mixed with other unary ops?

You explained somewhere the circumstances where you think this is
meaningful, but I can't remember what the rules are and I can't find the
exact post.

This is the problem. You shouldn't need to stop and think. I make the
rules simple by stipulating that value-returning ++ and -- only ever
return rvalues.

Because if they ever start to return lvalues, then this becomes possible:

++E := 0
E++ := 0

(Whichever one is legal in your scheme.) So I think there is little
useful expressivity to be gained.

Re: Dereference relative to increment and decrement operators ++ --

<tkt7rk$g4i$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!aioe.org!pMM5B9Rl/1LQCd+Nt14ETA.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Mon, 14 Nov 2022 12:12:52 +0100
Organization: Aioe.org NNTP Server
Message-ID: <tkt7rk$g4i$1@gioia.aioe.org>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkbf52$3kmic$1@dont-email.me> <tkbgnf$1nd8$1@gioia.aioe.org>
<tkd2j6$3s35k$1@dont-email.me> <tkd3lv$1g9o$1@gioia.aioe.org>
<tkrftl$1gtkg$4@dont-email.me> <tkrjfu$757$1@gioia.aioe.org>
<tkrl85$113l$1@gioia.aioe.org> <tkrm8q$1hee4$3@dont-email.me>
<tkrnj7$2g9$1@gioia.aioe.org> <tkrq1f$1hee4$5@dont-email.me>
<tkss3l$184b$1@gioia.aioe.org> <tkt4hd$1npeq$1@dont-email.me>
<tkt5gd$1ce8$1@gioia.aioe.org> <tkt73i$4vo$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="16530"; posting-host="pMM5B9Rl/1LQCd+Nt14ETA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Mon, 14 Nov 2022 11:12 UTC

On 2022-11-14 12:00, Bart wrote:
> On 14/11/2022 10:32, Dmitry A. Kazakov wrote:
>> On 2022-11-14 11:16, James Harris wrote:
>
>>>>>>>    a[i++] := b[j++]
>>>>>>
>>>>>> Same question. What for?
>>>>>
>>>>> What do you mean, "What for?"?
>>>>
>>>> Show me the algorithm.
>>>
>>> There's no particular algorithm; the construct is a potential
>>> component of many algorithms.
>>
>> Show me one that is not array assignment.
>
> What exactly is your objection: that there shouldn't be an increment
> operator at all?

There is no objection because, so far, there was no argument.
> Note that any language that has reference parameters would allow this:
>
>    a[postincr(i)] := b[postincr(j)]
>
> Or is that something else you're not keen on?

That language shall not have by-value or by-reference objects unless
explicitly contracted by the programmer. Forcing by-reference on scalars
is the best way to turn a modern processor into an i368.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Dereference relative to increment and decrement operators ++ --

<tkt8q5$sv3$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!aioe.org!pMM5B9Rl/1LQCd+Nt14ETA.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.misc
Subject: Re: Dereference relative to increment and decrement operators ++ --
Date: Mon, 14 Nov 2022 12:29:10 +0100
Organization: Aioe.org NNTP Server
Message-ID: <tkt8q5$sv3$1@gioia.aioe.org>
References: <tkarnt$3ivof$1@dont-email.me> <tkatah$1igr$1@gioia.aioe.org>
<tkav27$3j8p8$1@dont-email.me> <tkb22i$1us0$1@gioia.aioe.org>
<tkbf52$3kmic$1@dont-email.me> <tkbgnf$1nd8$1@gioia.aioe.org>
<tkd2j6$3s35k$1@dont-email.me> <tkd3lv$1g9o$1@gioia.aioe.org>
<tkrftl$1gtkg$4@dont-email.me> <tkrjfu$757$1@gioia.aioe.org>
<tkrl85$113l$1@gioia.aioe.org> <tkrm8q$1hee4$3@dont-email.me>
<tkrnj7$2g9$1@gioia.aioe.org> <tkrq1f$1hee4$5@dont-email.me>
<tkss3l$184b$1@gioia.aioe.org> <tkt4hd$1npeq$1@dont-email.me>
<tkt5gd$1ce8$1@gioia.aioe.org> <tkt7at$1o3kc$2@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="29667"; posting-host="pMM5B9Rl/1LQCd+Nt14ETA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.1
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Mon, 14 Nov 2022 11:29 UTC

On 2022-11-14 12:03, James Harris wrote:
> On 14/11/2022 10:32, Dmitry A. Kazakov wrote:
>> On 2022-11-14 11:16, James Harris wrote:
>>> On 14/11/2022 07:52, Dmitry A. Kazakov wrote:
>>>> On 2022-11-13 23:10, James Harris wrote:
>>>>> On 13/11/2022 21:29, Dmitry A. Kazakov wrote:
>>>>>> On 2022-11-13 22:06, James Harris wrote:
>>>>>>> On 13/11/2022 20:49, Bart wrote:
>>>>>>>> On 13/11/2022 20:19, Dmitry A. Kazakov wrote:
>>>>>>>>> On 2022-11-13 20:18, James Harris wrote:
>>>
>>> ...
>>>
>>>>>>>>>> Contrast
>>>>>>>>>>
>>>>>>>>>>    *p := *q
>>>>>>>>>>    p := p + 1
>>>>>>>>>>    q := q + 1
>>>>>>>>>>
>>>>>>>>>> Perhaps
>>>>>>>>>>
>>>>>>>>>>    +p++ := *q++
>>>>>>>>>>
>>>>>>>>>> expresses that part of the algorithm in a way which is more
>>>>>>>>>> natural and easier to read...?
>>>>>>>>>
>>>>>>>>> No algorithm requires you resort to pointers.
>>>>>>>
>>>>>>> This doesn't have to be about pointers, Dmitry. One could just as
>>>>>>> easily have
>>>>>>>
>>>>>>>    a[i++] := b[j++]
>>>>>>
>>>>>> Same question. What for?
>>>>>
>>>>> What do you mean, "What for?"?
>>>>
>>>> Show me the algorithm.
>>>
>>> There's no particular algorithm; the construct is a potential
>>> component of many algorithms.
>>
>> Show me one that is not array assignment.
>
>   if is_name_first(b[j])
>     a[i++] = b[j++]
>     rep while is_name_follow(b[j])
>       a[i++] = b[j++]
>     end rep
>     a[i] = 0
>     return TOK_NAME
>   end if
>
> Now, what don't you like about the ++ operators in that? How would you
> prefer to write it?

From parser production code:

procedure Get_Identifier
( Code : in out Source'Class;
Line : String;
Pointer : Integer;
Argument : out Tokens.Argument_Token
) is
Index : Integer := Pointer + 1;
Malformed : Boolean := False;
Underline : Boolean := False;
Symbol : Character;
begin
while Index <= Line'Last loop
Symbol := Line (Index);
if Is_Alphanumeric (Symbol) then
Underline := False;
elsif '_' = Symbol then
Malformed := Malformed or Underline;
Underline := True;
else
exit;
end if;
Index := Index + 1;
end loop;
Malformed := Malformed or Underline;
Set_Pointer (Code, Index);
Argument.Location := Link (Code);
Argument.Value := new Identifier (Index - Pointer);
declare
This : Identifier renames Identifier (Argument.Value.all);
begin
This.Location := Argument.Location;
This.Malformed := Malformed;
This.Value := Line (Pointer..Index - 1);
end;
end Get_Identifier;

>>> It's as though someone points out a brick and someone else says "what
>>> does it mean?"
>>
>> No, it is like building up a brick factory in your back garden for the
>> purpose of cracking walnuts...
>
> Says the man who likes Ada! ;-)
>
>>>>>> Why not a[i expexp(Pi) sqrtsqrt] := b[j!!]. Where are post square
>>>>>> root, post exponentiation, post factorial when the humankind need
>>>>>> them so bad?
>>>>>
>>>>> I cannot tell what point you are trying to make.
>>>>
>>>> There exist an infinite number of combinations that could be
>>>> operators. E.g. divide by two and reboot the computer.
>>>
>>> OK. ATM I have a generous **but limited** number of operators.
>>
>> Limited by which criteria?
>
> The set of operators is limited to what's reasonably necessary such as
> the usual stuff: function calls, array references, field selection,
> bitwise operations, arithmetic, comparison, boolean and assignment. Most
> are present in C; only a few are not such as bitwise combinations (e.g.
> nand and nor) and these two: concatenate and boolean (aka logical) xor.
> What's so bad about that?

You came to a conclusion without putting any objective criteria upfront.

>>> Again, IMO it's important for the language to provide such
>>> pseudofunctions so that a programmer's code can be made clearer,
>>> simpler, and more readable.
>>
>> Like this one?
>>
>>     ++p+++
>
> I don't have a +++ operator so I am not sure what that is supposed to
> mean. It's no valid in my language.

It could a part of even simpler and brilliantly readable:

++p+++q+++r

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


devel / comp.lang.misc / Re: Dereference relative to increment and decrement operators ++ --

Pages:1234567
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor