Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

A year spent in artificial intelligence is enough to make one believe in God.


devel / comp.lang.c / Re: structs passed by copy

SubjectAuthor
* structs passed by copyThiago Adams
+* Re: structs passed by copyKenny McCormack
|+* Re: structs passed by copyAnton Shepelev
||+* Re: structs passed by copyKenny McCormack
|||+- Re: structs passed by copyKaz Kylheku
|||`* Re: structs passed by copyJoe Pfeiffer
||| +- Re: structs passed by copyKenny McCormack
||| `* Re: structs passed by copyKeith Thompson
|||  `* Re: structs passed by copyJames Kuyper
|||   +- Re: structs passed by copyChris M. Thomasson
|||   `* Re: structs passed by copyKeith Thompson
|||    +* Re: structs passed by copyChris M. Thomasson
|||    |`- Re: structs passed by copyChris M. Thomasson
|||    `* Re: structs passed by copyJames Kuyper
|||     `* Re: structs passed by copyKeith Thompson
|||      +- Re: structs passed by copyRichard Damon
|||      +* Re: structs passed by copyDavid Brown
|||      |`* Re: structs passed by copyKeith Thompson
|||      | `* Re: structs passed by copyDavid Brown
|||      |  `* Re: structs passed by copyMichael S
|||      |   `* Re: structs passed by copyBen Bacarisse
|||      |    `* Re: structs passed by copyMichael S
|||      |     +* Re: structs passed by copyfir
|||      |     |`* Re: structs passed by copyfir
|||      |     | `* Re: structs passed by copyfir
|||      |     |  `* Re: structs passed by copyfir
|||      |     |   `* Re: structs passed by copyfir
|||      |     |    `* Re: structs passed by copyfir
|||      |     |     +- Re: structs passed by copyfir
|||      |     |     +- Re: structs passed by copyfir
|||      |     |     `- Re: structs passed by copyfir
|||      |     `* Re: structs passed by copyBen Bacarisse
|||      |      `- Re: structs passed by copyMichael S
|||      `* Re: structs passed by copyTim Rentsch
|||       `* Re: structs passed by copyKeith Thompson
|||        +* Re: structs passed by copyJames Kuyper
|||        |`- Re: structs passed by copyKeith Thompson
|||        `* Re: structs passed by copyTim Rentsch
|||         `* Re: structs passed by copyKeith Thompson
|||          `* Re: structs passed by copyKeith Thompson
|||           `* Re: structs passed by copyPhil Carmody
|||            `* Re: structs passed by copyKeith Thompson
|||             `* Re: structs passed by copyTim Rentsch
|||              +* Re: structs passed by copyKeith Thompson
|||              |`* Re: structs passed by copyTim Rentsch
|||              | `- Re: structs passed by copyKeith Thompson
|||              `* Re: structs passed by copyJohn Forkosh
|||               +- Re: structs passed by copyKeith Thompson
|||               +- Re: structs passed by copyMichael S
|||               `- Re: structs passed by copyTim Rentsch
||`* Re: structs passed by copyJames Kuyper
|| `* Re: structs passed by copyAnton Shepelev
||  `- Re: structs passed by copyRichard Damon
|+- Re: structs passed by copyThiago Adams
|`- Re: structs passed by copyantispam
+* Re: structs passed by copyBlue-Maned_Hawk
|`- Re: structs passed by copyKeith Thompson
+- Re: structs passed by copyKeith Thompson
+* Re: structs passed by copyBart
|`* Re: structs passed by copyThiago Adams
| +- Re: structs passed by copyKeith Thompson
| `* Re: structs passed by copyBart
|  `- Re: structs passed by copyfir
+- Re: structs passed by copyRichard Damon
+* Re: structs passed by copyChris M. Thomasson
|`- Re: structs passed by copyChris M. Thomasson
+- Re: structs passed by copyDavid Brown
+- Re: structs passed by copyOpus
+* Re: structs passed by copyMichael S
|`* Re: structs passed by copyThiago Adams
| `* Re: structs passed by copyBen Bacarisse
|  +* Re: structs passed by copyfir
|  |`* Re: structs passed by copyfir
|  | `* Re: structs passed by copyfir
|  |  `* Re: structs passed by copyfir
|  |   `* Re: structs passed by copyfir
|  |    +- Re: structs passed by copyfir
|  |    `- Re: structs passed by copyfir
|  +* Re: structs passed by copyChris M. Thomasson
|  |`* Re: structs passed by copyBen Bacarisse
|  | `* Re: structs passed by copyChris M. Thomasson
|  |  `* Re: structs passed by copyBen Bacarisse
|  |   +- Re: structs passed by copyChris M. Thomasson
|  |   `* Re: structs passed by copyThiago Adams
|  |    `- Re: structs passed by copyDavid Brown
|  `* Re: structs passed by copyThiago Adams
|   `- Re: structs passed by copyBen Bacarisse
+* Re: structs passed by copyJorgen Grahn
|+* Re: structs passed by copyKeith Thompson
||+* Re: structs passed by copyÖö Tiib
|||`* Re: structs passed by copyKeith Thompson
||| +* Re: structs passed by copyJames Kuyper
||| |+* Re: structs passed by copyDavid Brown
||| ||`* Re: structs passed by copyVir Campestris
||| || `* Re: structs passed by copyDavid Brown
||| ||  `* Re: structs passed by copyThiago Adams
||| ||   `* Re: structs passed by copyThiago Adams
||| ||    `* Re: structs passed by copyDavid Brown
||| ||     `* Re: structs passed by copyThiago Adams
||| ||      `* Re: structs passed by copyDavid Brown
||| ||       `* Re: structs passed by copybart c
||| |`- Re: structs passed by copyKeith Thompson
||| +- Re: structs passed by copyÖö Tiib
||| `- Re: structs passed by copyAndrey Tarasevich
||+- Re: structs passed by copyChris M. Thomasson
||+- Grammar nitpick (Was: structs passed by copy)Kenny McCormack
||`* Re: structs passed by copyTim Rentsch
|`* Re: structs passed by copyTim Rentsch
+* Re: structs passed by copyMaciej Zelma
`* Re: structs passed by copyBonita Montero

Pages:123456
Re: structs passed by copy

<46f9f705-e9d1-4849-90fa-fd6e372cc6dcn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:5c0f:b0:3b6:3a58:911a with SMTP id gd15-20020a05622a5c0f00b003b63a58911amr782371qtb.350.1674443218562;
Sun, 22 Jan 2023 19:06:58 -0800 (PST)
X-Received: by 2002:a81:7047:0:b0:4bc:e7dc:16bc with SMTP id
l68-20020a817047000000b004bce7dc16bcmr2689679ywc.368.1674443218254; Sun, 22
Jan 2023 19:06:58 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 22 Jan 2023 19:06:58 -0800 (PST)
In-Reply-To: <874jsiw6c8.fsf@bsb.me.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=45.174.239.81; posting-account=xFcAQAoAAAAoWlfpQ6Hz2n-MU9fthxbY
NNTP-Posting-Host: 45.174.239.81
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<4707042e-7997-4082-a44a-6357d5b80f6en@googlegroups.com> <9313da4a-ca1f-4053-beea-024628e68897n@googlegroups.com>
<87y1puwonv.fsf@bsb.me.uk> <tqk8cf$38mgc$1@dont-email.me> <87cz76w8h0.fsf@bsb.me.uk>
<tqkc8p$38vtv$3@dont-email.me> <874jsiw6c8.fsf@bsb.me.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <46f9f705-e9d1-4849-90fa-fd6e372cc6dcn@googlegroups.com>
Subject: Re: structs passed by copy
From: thiago.a...@gmail.com (Thiago Adams)
Injection-Date: Mon, 23 Jan 2023 03:06:58 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Thiago Adams - Mon, 23 Jan 2023 03:06 UTC

On Sunday, January 22, 2023 at 7:30:12 PM UTC-3, Ben Bacarisse wrote:
> "Chris M. Thomasson" <chris.m.t...@gmail.com> writes:
>
> > On 1/22/2023 1:43 PM, Ben Bacarisse wrote:
> >> "Chris M. Thomasson" <chris.m.t...@gmail.com> writes:
> >>
> >>> On 1/22/2023 7:54 AM, Ben Bacarisse wrote:
> >>>> Thiago Adams <thiago...@gmail.com> writes:
> >>>>
> >>>>> On Saturday, January 21, 2023 at 9:55:10 PM UTC-3, Michael S wrote:
> >>>>>> On Friday, January 20, 2023 at 8:41:16 PM UTC+2, Thiago Adams wrote:
> >>>>>>> At first edition of "The C programming language" we can see
> >>>>>>> that structs could not be passed directly as function arguments.
> >>>>>>> They also could not be returned from functions and assigned.
> >>>>>>>
> >>>>>>> Soon after [1], the language changed to allow assignment and make
> >>>>>>> structs arguments passed by copy by default.
> >>>>>>>
> >>>>>>> Today, I have 0% of structs being passed by copy in my code.
> >>>>>>> So for me this is a very bad default.
> >>>>>>>
> >>>>>>> If structs where passed by reference this would not be the only
> >>>>>>> exception on the type system because arrays are already passed
> >>>>>>> as pointers.
> >>>>>>>
> >>>>>>> Do you have structs passed by copy in your code?
> >>>>>> Yes, I do.
> >>>>>>> Could it be replaced by const * ?
> >>>>>> Not 100%
> >>>>>>> Considering your answer would you agree with me that this is a bad default?
> >>>>>> No, it is the only sane option.
> >>>>>> The early C that didn't have it was inconsistent.
> >>>>>> And I don't understand why do you call it "default'.
> >>>>>
> >>>>> I guess the other option was to make structs arguments passed by
> >>>>> reference. The same for arrays.
> >>>>
> >>>> (I'd say "and the same for arrays". As it stands, it could sound like
> >>>> you think arrays are currently "passed by reference". I know you don;t
> >>>> think that, but it's a common enough misconception that you'd want to
> >>>> avoid any hint of it.)
> >>>>
> >>>>> void f(struct X x, int a[2]) {
> >>>>> // sizeof(x) and sizeof(a) would not be sizeof pointer
> >>>>> }
> >>>>>
> >>>>> no need for -> everywhere inside structs.
> >>>> And now you have a different anomaly in the language. Everything except
> >>>> structs and arrays are passed by reference.
> >>>
> >>> I must be misunderstanding you here.
> >> No, you are understand what I wrote but I wrote the wrong thing. I
> >> meant to write "by value". It's a common mistake I make. I write it
> >> one way, then edit in a way that makes things clearer but sometimes I
> >> forget to edit a key part, and "except" or a "not" or an "otherwise"!
> >>
> >>> ? Where did I misunderstand you Ben?
> >>
> >> Nowhere! Thanks for spotting it.
> >> "And now you have a different anomaly in the language. Everything
> >> except structs and arrays are passed by value."
> >
> > Can't a struct be passed by value? I see the _except_ clause in your
> > sentence. Some quick code typed in the damn newsreader, sorry for any
> > typos!
> In current C, yes, but I was commenting on TA's suggestion that passing
> of structs and arrays should be changed.

I don´t have a suggestion to change C right now, because of the impact
of existing code that is modifying a copy of the argument.

>In TA's suggestion, these
> would be always be passed by reference. He seemed to want to tidy
> something up, but the effect is to create a new anomaly.
>
> May I should have said "would be" rather than "are" to keep it clear
> that I am talking about a hypothetical language.
>
Yes I am talking about a time machine. If I was there I would recommend
by reference.
I searched but I didn't find the rationally for structs by value and
arrays (similar of references). We can just imagine some reasons.
Maybe it would broke some existing code for arrays for instance. And not
for structs because structs were not allowed in arguments.

I also would like to know the decision of this decorative array on arguments.
And also why when in C99 they added [static N] in arrays instead of just
making the past decorative syntax behave like [static N].

Re: structs passed by copy

<tqll1e$3if0k$4@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: structs passed by copy
Date: Mon, 23 Jan 2023 10:46:22 +0100
Organization: A noiseless patient Spider
Lines: 67
Message-ID: <tqll1e$3if0k$4@dont-email.me>
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com>
<20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 23 Jan 2023 09:46:23 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="56245235af5286c4d2cd18388cd57e36";
logging-data="3750932"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+iXkkyNRhc8ZnZIYWiNaQGmGUo64bi8x8="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:RlsU3KYCL1Y4uup/FvA6oKG2DdE=
In-Reply-To: <87o7qqglva.fsf@nosuchdomain.example.com>
Content-Language: en-GB
 by: David Brown - Mon, 23 Jan 2023 09:46 UTC

On 23/01/2023 01:01, Keith Thompson wrote:
> James Kuyper <jameskuyper@alumni.caltech.edu> writes:
>> On 1/22/23 16:27, Keith Thompson wrote:
>>> James Kuyper <jameskuyper@alumni.caltech.edu> writes:
>> ...
>>>> Just as it is extremely common for numbers to be pure-real, with no
>>>> imaginary part, it is not uncommon, when doing physics or engineering
>>>> using complex values, to have some of those quantities being calculated
>>>> to be guaranteed to be pure imaginary. Storing such quantities using
>>>> _Imaginary types reduces the space required by a factor of 2, which can
>>>> be important if you have huge arrays of them (not an uncommon feature of
>>>> physics/engineering programs). More importantly, I think, is that use of
>>>> such types should enable warnings about questionable uses of such types,
>>>> such as taking the Real part of them.
>>>>
>>>> It's certainly not impossible to work with such quantities efficiently
>>>> without using the _Imaginary types - before the introduction of those
>>>> types, they could have been stored as real values, with a comment
>>>> indicating that these real values are the imaginary component of the
>>>> actual value. However, making _Imaginary a part of the declaration of
>>>> such objects is better than relying upon people to notice such a comment.
>>>
>>> Thanks, I didn't know that.
>>>
>>> Given that imaginary types are useful, I wonder why they're not
>>> widely supported. Neither gcc 12.2.0 nor clang 15.0.0 supports
>>> `_Imaginary double`.
>>>
>>> And both predefine __STDC_IEC_559_COMPLEX__, which if I'm reading
>>> Annex G correctly implies that they're required to support imaginary
>>> types.
>
> I was wrong about this; see below.
>
>> I said that they could be useful. I didn't address how useful they would
>> be. I don't imagine that the usefulness is great. I hope the committee
>> had some evidence of actual demand for such a feature before deciding to
>> add it to the language.
>
> There are still a few things I'm curious about:
>
> Why did the committee choose to make complex numbers mandatory and
> imaginary numbers optional? I wouldn't expect imaginary numbers
> to be very difficult to implement once you have complex numbers.
> Nor would I expect users of one C implementation to have a greater
> need for them than users of another (which would have been a
> reasonable basis for making them optional).
>

I also wonder why the committee choose to make complex numbers mandatory
in C99, then optional in C11. Complex numbers are not particularly hard
to implement (once you have all the rest of floating point support and
<math.h>), and on the user side they are zero cost if you don't use them.

> Have any C compilers implemented _Imaginary? (If not, it seems
> like a failed experiment.)
>

I note that C++ does not have a standard library "imaginary" type
either. I suppose there simply hasn't been much call for such a type in
practice - you can always handle them yourself using real types, as long
as you are careful about usage in expressions. (And in C++, you could
easily make a wrapper class so you don't have to be careful!)

Re: structs passed by copy

<tqllh2$3if0k$5@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: structs passed by copy
Date: Mon, 23 Jan 2023 10:54:42 +0100
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <tqllh2$3if0k$5@dont-email.me>
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<4707042e-7997-4082-a44a-6357d5b80f6en@googlegroups.com>
<9313da4a-ca1f-4053-beea-024628e68897n@googlegroups.com>
<87y1puwonv.fsf@bsb.me.uk> <tqk8cf$38mgc$1@dont-email.me>
<87cz76w8h0.fsf@bsb.me.uk> <tqkc8p$38vtv$3@dont-email.me>
<874jsiw6c8.fsf@bsb.me.uk>
<46f9f705-e9d1-4849-90fa-fd6e372cc6dcn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 23 Jan 2023 09:54:42 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="56245235af5286c4d2cd18388cd57e36";
logging-data="3750932"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Q30+/E1mtsZ13F4BU/lpU1jZqiFdCX+4="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:hm7/LW9V5hO3Juk9yvB8yv8xfGM=
In-Reply-To: <46f9f705-e9d1-4849-90fa-fd6e372cc6dcn@googlegroups.com>
Content-Language: en-GB
 by: David Brown - Mon, 23 Jan 2023 09:54 UTC

On 23/01/2023 04:06, Thiago Adams wrote:
> On Sunday, January 22, 2023 at 7:30:12 PM UTC-3, Ben Bacarisse wrote:
>> "Chris M. Thomasson" <chris.m.t...@gmail.com> writes:
>>

>>> Can't a struct be passed by value? I see the _except_ clause in your
>>> sentence. Some quick code typed in the damn newsreader, sorry for any
>>> typos!
>> In current C, yes, but I was commenting on TA's suggestion that passing
>> of structs and arrays should be changed.
>
> I don´t have a suggestion to change C right now, because of the impact
> of existing code that is modifying a copy of the argument.
>
Surely the solution is simple (assuming you are happy making a compiler
for a non-standard modified C)? Add references in the style of C++.
Then existing code will work fine as it is, and if you want to pass
structs by reference, you can do so by declaring the appropriate
parameter as a reference parameter. You get the best of both worlds,
while using a syntax and concepts that are already familiar to many people.

Re: structs passed by copy

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

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: structs passed by copy
Date: Mon, 23 Jan 2023 12:14:24 +0000
Organization: A noiseless patient Spider
Lines: 74
Message-ID: <87sfg1tplr.fsf@bsb.me.uk>
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<4707042e-7997-4082-a44a-6357d5b80f6en@googlegroups.com>
<9313da4a-ca1f-4053-beea-024628e68897n@googlegroups.com>
<87y1puwonv.fsf@bsb.me.uk>
<5fcdfb61-5739-4a29-8256-7e64062277c6n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="16af8d14f8ef0a103426ac7dff431e0e";
logging-data="3800715"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+FOuFCeLU4ZOMqK6RQibdicHVl80W9LCQ="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:YUkQat3S5hoNLbsyjClW6LtY50I=
sha1:IeK5hn0ZNcYXmvtdt8FHhWIFxPA=
X-BSB-Auth: 1.139b9c6e98a04caeb6ce.20230123121424GMT.87sfg1tplr.fsf@bsb.me.uk
 by: Ben Bacarisse - Mon, 23 Jan 2023 12:14 UTC

Thiago Adams <thiago.adams@gmail.com> writes:

> On Sunday, January 22, 2023 at 12:54:28 PM UTC-3, Ben Bacarisse wrote:
>> Thiago Adams <thiago...@gmail.com> writes:
>>
>> > On Saturday, January 21, 2023 at 9:55:10 PM UTC-3, Michael S wrote:
>> >> On Friday, January 20, 2023 at 8:41:16 PM UTC+2, Thiago Adams wrote:
>> >> > At first edition of "The C programming language" we can see
>> >> > that structs could not be passed directly as function arguments.
>> >> > They also could not be returned from functions and assigned.
>> >> >
>> >> > Soon after [1], the language changed to allow assignment and make
>> >> > structs arguments passed by copy by default.
>> >> >
>> >> > Today, I have 0% of structs being passed by copy in my code.
>> >> > So for me this is a very bad default.
>> >> >
>> >> > If structs where passed by reference this would not be the only
>> >> > exception on the type system because arrays are already passed
>> >> > as pointers.
>> >> >
>> >> > Do you have structs passed by copy in your code?
>> >> Yes, I do.
>> >> > Could it be replaced by const * ?
>> >> Not 100%
>> >> > Considering your answer would you agree with me that this is a bad default?
>> >> No, it is the only sane option.
>> >> The early C that didn't have it was inconsistent.
>> >> And I don't understand why do you call it "default'.
>> >
>> > I guess the other option was to make structs arguments passed by
>> > reference. The same for arrays.
>> (I'd say "and the same for arrays". As it stands, it could sound like
>> you think arrays are currently "passed by reference". I know you don;t
>> think that, but it's a common enough misconception that you'd want to
>> avoid any hint of it.)
>> > void f(struct X x, int a[2]) {
>> > // sizeof(x) and sizeof(a) would not be sizeof pointer
>> > }
>
> It works as if arrays were reference. Like
>
> void f(int a[2]){
> a[0] = 1;
> }
> int main() {
> int a[2] = {0};
> f(a);
> assert(a[0] == 1);
> }
>
> And no need for address of.
>
>> > no need for -> everywhere inside structs.
>>
>> And now you have a different anomaly in the language. Everything except
>> structs and arrays are passed by [value].

(I have corrected my editing error in the above.)

> Don`t you think arrays already look like an anomaly? See the sample
> above.

Yes, they are. My point is you switch one for another so I don't see
the point.

And your suggestion does address what happens with arrays in /other/
contexts, so it's possible you are, in fact, adding a new anomaly to the
exiting array one. At least arrays are widely anomalous -- it's not
just when passed to functions that array names decay to pointers. You
have to lean this peculiarity in about lesson two when learning C!

--
Ben.

Re: structs passed by copy

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

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: structs passed by copy
Date: Mon, 23 Jan 2023 12:15:49 -0800
Organization: None to speak of
Lines: 21
Message-ID: <878rhtgg7e.fsf@nosuchdomain.example.com>
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com>
<20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com>
<tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com>
<tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com>
<tqll1e$3if0k$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="d34d0f49d825817f6e40612c0dbcdea1";
logging-data="3949203"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Y/lfq5YnzksJThoIZpY3s"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:lcftaBykToGRmjSdj+YNMfFKqZ4=
sha1:r65XSc58N2yKZEBck9NRO7t/Vbk=
 by: Keith Thompson - Mon, 23 Jan 2023 20:15 UTC

David Brown <david.brown@hesbynett.no> writes:
[...]
> I also wonder why the committee choose to make complex numbers
> mandatory in C99, then optional in C11. Complex numbers are not
> particularly hard to implement (once you have all the rest of floating
> point support and <math.h>), and on the user side they are zero cost
> if you don't use them.

I had forgotten that C11 made complex numbers optional. I agree that it
was an odd decision, as was making VLAs optional.

Making a feature optional could be a good first step towards making it
mandatory in a future edition of the standard. Making an existing
mandatory feature optional makes less sense to me.

[...]

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */

Re: structs passed by copy

<tqmrp4$3p3fg$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: structs passed by copy
Date: Mon, 23 Jan 2023 21:47:32 +0100
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <tqmrp4$3p3fg$1@dont-email.me>
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com>
<20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com> <tqll1e$3if0k$4@dont-email.me>
<878rhtgg7e.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 23 Jan 2023 20:47:32 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="91e9af5c1a5eb99639da3ee199a510df";
logging-data="3968496"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/V/dImlrfHDaITErjELMh3EYlWwCeqrRA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:IMKcDFxXk439vG4gF8v8AqwiUIM=
In-Reply-To: <878rhtgg7e.fsf@nosuchdomain.example.com>
Content-Language: en-GB
 by: David Brown - Mon, 23 Jan 2023 20:47 UTC

On 23/01/2023 21:15, Keith Thompson wrote:
> David Brown <david.brown@hesbynett.no> writes:
> [...]
>> I also wonder why the committee choose to make complex numbers
>> mandatory in C99, then optional in C11. Complex numbers are not
>> particularly hard to implement (once you have all the rest of floating
>> point support and <math.h>), and on the user side they are zero cost
>> if you don't use them.
>
> I had forgotten that C11 made complex numbers optional. I agree that it
> was an odd decision, as was making VLAs optional.
>
> Making a feature optional could be a good first step towards making it
> mandatory in a future edition of the standard. Making an existing
> mandatory feature optional makes less sense to me.
>

Could it have been pressure from a certain major compiler manufacturer
who has been extremely slow at implementing some C99 features, other
than those that were also part of C++ ? Perhaps they wanted to change
their reputation of being poor at C because they were far from C99
compliant, and they could now get C11 compliance with less effort.

Or maybe that's just a conspiracy theory :-)

Re: structs passed by copy

<d20c6408-77be-4e47-8724-91d9e2701b8bn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:4c1d:b0:532:2e21:8c0a with SMTP id qh29-20020a0562144c1d00b005322e218c0amr1169103qvb.78.1674508912782;
Mon, 23 Jan 2023 13:21:52 -0800 (PST)
X-Received: by 2002:a81:9244:0:b0:426:6938:b154 with SMTP id
j65-20020a819244000000b004266938b154mr3600541ywg.511.1674508912599; Mon, 23
Jan 2023 13:21:52 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 23 Jan 2023 13:21:52 -0800 (PST)
In-Reply-To: <tqmrp4$3p3fg$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a0d:6fc2:55b0:ca00:18a5:d365:1d2b:77b8;
posting-account=ow8VOgoAAAAfiGNvoH__Y4ADRwQF1hZW
NNTP-Posting-Host: 2a0d:6fc2:55b0:ca00:18a5:d365:1d2b:77b8
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com> <20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com> <tqll1e$3if0k$4@dont-email.me>
<878rhtgg7e.fsf@nosuchdomain.example.com> <tqmrp4$3p3fg$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d20c6408-77be-4e47-8724-91d9e2701b8bn@googlegroups.com>
Subject: Re: structs passed by copy
From: already5...@yahoo.com (Michael S)
Injection-Date: Mon, 23 Jan 2023 21:21:52 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3091
 by: Michael S - Mon, 23 Jan 2023 21:21 UTC

On Monday, January 23, 2023 at 10:47:45 PM UTC+2, David Brown wrote:
> On 23/01/2023 21:15, Keith Thompson wrote:
> > David Brown <david...@hesbynett.no> writes:
> > [...]
> >> I also wonder why the committee choose to make complex numbers
> >> mandatory in C99, then optional in C11. Complex numbers are not
> >> particularly hard to implement (once you have all the rest of floating
> >> point support and <math.h>), and on the user side they are zero cost
> >> if you don't use them.
> >
> > I had forgotten that C11 made complex numbers optional. I agree that it
> > was an odd decision, as was making VLAs optional.
> >
> > Making a feature optional could be a good first step towards making it
> > mandatory in a future edition of the standard. Making an existing
> > mandatory feature optional makes less sense to me.
> >
> Could it have been pressure from a certain major compiler manufacturer
> who has been extremely slow at implementing some C99 features, other
> than those that were also part of C++ ? Perhaps they wanted to change
> their reputation of being poor at C because they were far from C99
> compliant, and they could now get C11 compliance with less effort.
>
>
> Or maybe that's just a conspiracy theory :-)

I'd guess, that's part of the reason.
The other part is desire to make 'C' maximally close to a subset of C++.

Re: structs passed by copy

<86fsc0hl4i.fsf@linuxsc.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: structs passed by copy
Date: Mon, 23 Jan 2023 15:44:13 -0800
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <86fsc0hl4i.fsf@linuxsc.com>
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com> <tqeoet$2r8gf$1@news.xmission.com> <20230120230138.1225d36e5ad8e5f07401c67a@gmail.com> <tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net> <87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me> <87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me> <87o7qqglva.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader01.eternal-september.org; posting-host="c6b31012a9551ab5c55cbf393aa16f93";
logging-data="4027096"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+N+oAuqrp4En5wFCGPylgVzzj8+d2THPI="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:KF7ykXgn1a0UR8EYwZ64jLNle+I=
sha1:hfBGYvsWQJQIYxXIFOKZ4Akv96M=
 by: Tim Rentsch - Mon, 23 Jan 2023 23:44 UTC

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

[...]

> BTW, I was wrong about one thing: Support for _Imaginary is optional
> even for an implementation that predefines __STDC_IEC_559_COMPLEX__.
> `#ifdef _Imaginary_I` can be used to detect whether an implementation
> supports imaginary types.

I don't see how you reach this conclusion. My reading of N1570 says
an implementation that defines __STDC_IEC_559_COMPLEX__ must have
imaginary types. Annex G is normative. It clearly states that an
implementation that defines __STDC_IEC_559_COMPLEX__ must conform to
its specifications. Section G.2 says _Imaginary is a keyword, and
there are three imaginary types, float _Imaginary, double _Imaginary,
and long double _Imaginary. That statement (actually a combination of
two statements in the annex) is a specification, and so any designated
implementation must conform to it.

In section 7.3.1, paragraph 5 says that the two macros 'imaginary' and
'_Imaginary_I' are defined if and only if the implementation supports
imaginary types, but I don't see that it gives any license to overrule
any other statement in the standard. Annex G is clear that there are
imaginary types, and the implementation must provide them. I don't
see any wiggle room at all. What is the reasoning behind what you
say above?

Re: structs passed by copy

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

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: structs passed by copy
Date: Mon, 23 Jan 2023 23:49:49 +0000
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <878rhssteq.fsf@bsb.me.uk>
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com>
<20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com>
<tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com>
<tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com>
<tqll1e$3if0k$4@dont-email.me>
<878rhtgg7e.fsf@nosuchdomain.example.com>
<tqmrp4$3p3fg$1@dont-email.me>
<d20c6408-77be-4e47-8724-91d9e2701b8bn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="ccfbb7ff8af90e61c425cefb4c2c8317";
logging-data="4027189"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19mMK8Vm5PLbl6lYSg78ArBR9jNri6WHb4="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:tCQaDk2OZytyPvXhhYf8NP5Sbho=
sha1:NDXwyBU7O8DM14soey9lkKfj7MY=
X-BSB-Auth: 1.627a147f381f8b9ab9ee.20230123234949GMT.878rhssteq.fsf@bsb.me.uk
 by: Ben Bacarisse - Mon, 23 Jan 2023 23:49 UTC

Michael S <already5chosen@yahoo.com> writes:

> On Monday, January 23, 2023 at 10:47:45 PM UTC+2, David Brown wrote:
>> On 23/01/2023 21:15, Keith Thompson wrote:
>> > David Brown <david...@hesbynett.no> writes:
>> > [...]
>> >> I also wonder why the committee choose to make complex numbers
>> >> mandatory in C99, then optional in C11. Complex numbers are not
>> >> particularly hard to implement (once you have all the rest of floating
>> >> point support and <math.h>), and on the user side they are zero cost
>> >> if you don't use them.
>> >
>> > I had forgotten that C11 made complex numbers optional. I agree that it
>> > was an odd decision, as was making VLAs optional.
>> >
>> > Making a feature optional could be a good first step towards making it
>> > mandatory in a future edition of the standard. Making an existing
>> > mandatory feature optional makes less sense to me.
>> >
>> Could it have been pressure from a certain major compiler manufacturer
>> who has been extremely slow at implementing some C99 features, other
>> than those that were also part of C++ ? Perhaps they wanted to change
>> their reputation of being poor at C because they were far from C99
>> compliant, and they could now get C11 compliance with less effort.
>>
>> Or maybe that's just a conspiracy theory :-)
>
> I'd guess, that's part of the reason.
> The other part is desire to make 'C' maximally close to a subset of
> C++.

But then C++ has had complex numbers (alost from the get-go), so maybe
not!

--
Ben.

Re: structs passed by copy

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

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: structs passed by copy
Date: Mon, 23 Jan 2023 16:37:03 -0800
Organization: None to speak of
Lines: 54
Message-ID: <87a628g440.fsf@nosuchdomain.example.com>
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com>
<20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com>
<tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com>
<tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com> <86fsc0hl4i.fsf@linuxsc.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="25d49d288691187a26dd1f347fb4f747";
logging-data="4043443"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19tUJnNMJZTDdPmqnELLM/O"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:NJI4Om7hejrX2xxYDDsB5Q+Z4h8=
sha1:c6D9r20Q2XkSxa+j+5Lxv9s9X2Y=
 by: Keith Thompson - Tue, 24 Jan 2023 00:37 UTC

Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>
> [...]
>
>> BTW, I was wrong about one thing: Support for _Imaginary is optional
>> even for an implementation that predefines __STDC_IEC_559_COMPLEX__.
>> `#ifdef _Imaginary_I` can be used to detect whether an implementation
>> supports imaginary types.
>
> I don't see how you reach this conclusion. My reading of N1570 says
> an implementation that defines __STDC_IEC_559_COMPLEX__ must have
> imaginary types. Annex G is normative. It clearly states that an
> implementation that defines __STDC_IEC_559_COMPLEX__ must conform to
> its specifications. Section G.2 says _Imaginary is a keyword, and
> there are three imaginary types, float _Imaginary, double _Imaginary,
> and long double _Imaginary. That statement (actually a combination of
> two statements in the annex) is a specification, and so any designated
> implementation must conform to it.

I believe you're correct, and I was wrong (the second time, not
the first). I honestly don't know how I reached the conclusion
that defining __STDC_IEC_559_COMPLEX__ *doesn't* imply a requirement
to support imaginary types. Most likely I read one document while
thinking it was a different one.

I apologize for the confusion.

> In section 7.3.1, paragraph 5 says that the two macros 'imaginary' and
> '_Imaginary_I' are defined if and only if the implementation supports
> imaginary types, but I don't see that it gives any license to overrule
> any other statement in the standard. Annex G is clear that there are
> imaginary types, and the implementation must provide them. I don't
> see any wiggle room at all. What is the reasoning behind what you
> say above?

I now think that an implementation that defines __STDC_IEC_559_COMPLEX__
(which is optional) must support imaginary types as described in Annex G.
The N1570 draft, of the C11 standard, and of the N3054 draft of C23
are all consistent on this point.

Both gcc and clang define __STDC_IEC_559_COMPLEX__ but do not support
imaginary types (with command-line options to make them attempt to be
fully conforming). I find it surprising that they would both be
non-conforming in such a seemingly obvious way. The gcc 12.2.0 manual
doesn't even mention the _Imaginary keyword.

(Both complex and imaginary types are optional in C11. And a conforming
implementation could support both without supporting Annex G.)

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */

Re: structs passed by copy

<tqnbb5$3rjfq$3@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: structs passed by copy
Date: Mon, 23 Jan 2023 20:13:09 -0500
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <tqnbb5$3rjfq$3@dont-email.me>
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com>
<20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com> <86fsc0hl4i.fsf@linuxsc.com>
<87a628g440.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 24 Jan 2023 01:13:09 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="4df52d76e6f1c5a92ca3872405074005";
logging-data="4050426"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18XQ9fQqqmjUdYYr+B1AGAqJKikxl29oRs="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:31SDkQuKhqsAizE4r1uH7nO6lLc=
Content-Language: en-US
In-Reply-To: <87a628g440.fsf@nosuchdomain.example.com>
 by: James Kuyper - Tue, 24 Jan 2023 01:13 UTC

On 1/23/23 19:37, Keith Thompson wrote:
> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>
>> [...]
>>
>>> BTW, I was wrong about one thing: Support for _Imaginary is optional
>>> even for an implementation that predefines __STDC_IEC_559_COMPLEX__.
>>> `#ifdef _Imaginary_I` can be used to detect whether an implementation
>>> supports imaginary types.
>>
>> I don't see how you reach this conclusion. My reading of N1570 says
>> an implementation that defines __STDC_IEC_559_COMPLEX__ must have
>> imaginary types. Annex G is normative. It clearly states that an
>> implementation that defines __STDC_IEC_559_COMPLEX__ must conform to
>> its specifications. Section G.2 says _Imaginary is a keyword, and
>> there are three imaginary types, float _Imaginary, double _Imaginary,
>> and long double _Imaginary. That statement (actually a combination of
>> two statements in the annex) is a specification, and so any designated
>> implementation must conform to it.
>
> I believe you're correct, and I was wrong (the second time, not
> the first). I honestly don't know how I reached the conclusion
> that defining __STDC_IEC_559_COMPLEX__ *doesn't* imply a requirement
> to support imaginary types. Most likely I read one document while
> thinking it was a different one.

I think you were on the right track from the beginning.

"The macros imaginary and _Imaginary_I are defined if and only if the
implementation supports imaginary types." (7.3.1p5)

That pretty clearly indicates that support for imaginary types is
optional. It wouldn't be needed if imaginary types were guaranteed to be
supported if complex types are supported.

Re: structs passed by copy

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

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: structs passed by copy
Date: Mon, 23 Jan 2023 17:58:00 -0800
Organization: None to speak of
Lines: 78
Message-ID: <87pmb4elsn.fsf@nosuchdomain.example.com>
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com>
<20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com>
<tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com>
<tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com> <86fsc0hl4i.fsf@linuxsc.com>
<87a628g440.fsf@nosuchdomain.example.com>
<tqnbb5$3rjfq$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="25d49d288691187a26dd1f347fb4f747";
logging-data="4060492"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Ctmg87Eoe3/u+lBeQXVYI"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:KsXyeX0emsSG0ErQYpEVfkI0YGA=
sha1:8pcm3iOsMgnO7Ss937/InvtV+1Q=
 by: Keith Thompson - Tue, 24 Jan 2023 01:58 UTC

James Kuyper <jameskuyper@alumni.caltech.edu> writes:
> On 1/23/23 19:37, Keith Thompson wrote:
>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>>
>>> [...]
>>>
>>>> BTW, I was wrong about one thing: Support for _Imaginary is optional
>>>> even for an implementation that predefines __STDC_IEC_559_COMPLEX__.
>>>> `#ifdef _Imaginary_I` can be used to detect whether an implementation
>>>> supports imaginary types.
>>>
>>> I don't see how you reach this conclusion. My reading of N1570 says
>>> an implementation that defines __STDC_IEC_559_COMPLEX__ must have
>>> imaginary types. Annex G is normative. It clearly states that an
>>> implementation that defines __STDC_IEC_559_COMPLEX__ must conform to
>>> its specifications. Section G.2 says _Imaginary is a keyword, and
>>> there are three imaginary types, float _Imaginary, double _Imaginary,
>>> and long double _Imaginary. That statement (actually a combination of
>>> two statements in the annex) is a specification, and so any designated
>>> implementation must conform to it.
>>
>> I believe you're correct, and I was wrong (the second time, not
>> the first). I honestly don't know how I reached the conclusion
>> that defining __STDC_IEC_559_COMPLEX__ *doesn't* imply a requirement
>> to support imaginary types. Most likely I read one document while
>> thinking it was a different one.
>
> I think you were on the right track from the beginning.
>
> "The macros imaginary and _Imaginary_I are defined if and only if the
> implementation supports imaginary types." (7.3.1p5)
>
> That pretty clearly indicates that support for imaginary types is
> optional. It wouldn't be needed if imaginary types were guaranteed to be
> supported if complex types are supported.

N1570 6.2.5 (Types) mentions complex types but not imaginary types,
other than in a footnote that refers to Annex G (and that incorrectly
says it's informative, as it was in C99). That seems like an odd
omission.

N1570 7.3.1 (<complex.h>) makes it clear that imaginary types are
optional (and that the macro I expands to an expression of either
complex or imaginary type, which seems really odd).

6.10.8.1: An implementation may predefine __STDC_NO_COMPLEX__ to
indicate that it doesn't support complex types (new in C11; in C99
complex types were mandatory).

My conclusions:

Support for complex types is optional.

Support for imaginary types is optional.

(Support for imaginary types but not complex types is probably allowed,
but would be silly.)

An implementation may optionally predefine __STDC_IEC_559_COMPLEX__.
Any implementation that does so must support both complex and imaginary
types, and must do so as specified by Annex G.

Recent versions of gcc and clang both predefine __STDC_IEC_559_COMPLEX__,
but neither supports imaginary types (with command-line options that
should make them conform to C11). This makes them non-conforming. I
feel like I might be missing something here, because it *seems* like an
obvious non-conformance, and I don't see anything about it on gcc's
bugzilla.

An implementation *could* support complex types, or complex and
imaginary types, without conforming to Annex G, for example if the
target platform doesn't support IEEE floating-point.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */

Re: structs passed by copy

<d17c6d83-8c66-4fbd-bb22-e006e3b395efn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:7206:0:b0:3b6:8c54:129e with SMTP id a6-20020ac87206000000b003b68c54129emr941367qtp.147.1674557176559;
Tue, 24 Jan 2023 02:46:16 -0800 (PST)
X-Received: by 2002:a0d:cb02:0:b0:506:464e:9f25 with SMTP id
n2-20020a0dcb02000000b00506464e9f25mr221028ywd.511.1674557176370; Tue, 24 Jan
2023 02:46:16 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 24 Jan 2023 02:46:16 -0800 (PST)
In-Reply-To: <878rhssteq.fsf@bsb.me.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=199.203.251.52; posting-account=ow8VOgoAAAAfiGNvoH__Y4ADRwQF1hZW
NNTP-Posting-Host: 199.203.251.52
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com> <20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com> <tqll1e$3if0k$4@dont-email.me>
<878rhtgg7e.fsf@nosuchdomain.example.com> <tqmrp4$3p3fg$1@dont-email.me>
<d20c6408-77be-4e47-8724-91d9e2701b8bn@googlegroups.com> <878rhssteq.fsf@bsb.me.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d17c6d83-8c66-4fbd-bb22-e006e3b395efn@googlegroups.com>
Subject: Re: structs passed by copy
From: already5...@yahoo.com (Michael S)
Injection-Date: Tue, 24 Jan 2023 10:46:16 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 47
 by: Michael S - Tue, 24 Jan 2023 10:46 UTC

On Tuesday, January 24, 2023 at 1:50:02 AM UTC+2, Ben Bacarisse wrote:
> Michael S <already...@yahoo.com> writes:
>
> > On Monday, January 23, 2023 at 10:47:45 PM UTC+2, David Brown wrote:
> >> On 23/01/2023 21:15, Keith Thompson wrote:
> >> > David Brown <david...@hesbynett.no> writes:
> >> > [...]
> >> >> I also wonder why the committee choose to make complex numbers
> >> >> mandatory in C99, then optional in C11. Complex numbers are not
> >> >> particularly hard to implement (once you have all the rest of floating
> >> >> point support and <math.h>), and on the user side they are zero cost
> >> >> if you don't use them.
> >> >
> >> > I had forgotten that C11 made complex numbers optional. I agree that it
> >> > was an odd decision, as was making VLAs optional.
> >> >
> >> > Making a feature optional could be a good first step towards making it
> >> > mandatory in a future edition of the standard. Making an existing
> >> > mandatory feature optional makes less sense to me.
> >> >
> >> Could it have been pressure from a certain major compiler manufacturer
> >> who has been extremely slow at implementing some C99 features, other
> >> than those that were also part of C++ ? Perhaps they wanted to change
> >> their reputation of being poor at C because they were far from C99
> >> compliant, and they could now get C11 compliance with less effort.
> >>
> >> Or maybe that's just a conspiracy theory :-)
> >
> > I'd guess, that's part of the reason.
> > The other part is desire to make 'C' maximally close to a subset of
> > C++.
> But then C++ has had complex numbers (alost from the get-go), so maybe
> not!
>
> --
> Ben.

C++ complex numbers are part of template library rather than of base language.
C99 complex numbers and C++ complex number are not merely incompatible,
forcing them to co-exist in the same program is not easy.
And then, we have IPP (Intel Performance Primitives) complex types to make
things more interesting.

But my previous comment had smaller scope. All I wanted to say is that
committee likely wants to reduce the # of 'C' programs that are neither
legal C++ nor can be turned into legal C++ programs easily by adding few casts
[that will still keep the legal C programs].
C99 VLA and complex numbers are by far the biggest obstacles here.

Re: structs passed by copy

<7a94e733-dc25-4e3e-90f4-d00f4dcf9318n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a37:2e43:0:b0:702:1fee:571d with SMTP id u64-20020a372e43000000b007021fee571dmr1117130qkh.253.1674562685543;
Tue, 24 Jan 2023 04:18:05 -0800 (PST)
X-Received: by 2002:a81:7106:0:b0:46a:9fd:82b5 with SMTP id
m6-20020a817106000000b0046a09fd82b5mr2805668ywc.346.1674562685330; Tue, 24
Jan 2023 04:18:05 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 24 Jan 2023 04:18:05 -0800 (PST)
In-Reply-To: <d17c6d83-8c66-4fbd-bb22-e006e3b395efn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.171; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.171
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com> <20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com> <tqll1e$3if0k$4@dont-email.me>
<878rhtgg7e.fsf@nosuchdomain.example.com> <tqmrp4$3p3fg$1@dont-email.me>
<d20c6408-77be-4e47-8724-91d9e2701b8bn@googlegroups.com> <878rhssteq.fsf@bsb.me.uk>
<d17c6d83-8c66-4fbd-bb22-e006e3b395efn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7a94e733-dc25-4e3e-90f4-d00f4dcf9318n@googlegroups.com>
Subject: Re: structs passed by copy
From: profesor...@gmail.com (fir)
Injection-Date: Tue, 24 Jan 2023 12:18:05 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 82
 by: fir - Tue, 24 Jan 2023 12:18 UTC

wtorek, 24 stycznia 2023 o 11:46:23 UTC+1 Michael S napisał(a):
> On Tuesday, January 24, 2023 at 1:50:02 AM UTC+2, Ben Bacarisse wrote:
> > Michael S <already...@yahoo.com> writes:
> >
> > > On Monday, January 23, 2023 at 10:47:45 PM UTC+2, David Brown wrote:
> > >> On 23/01/2023 21:15, Keith Thompson wrote:
> > >> > David Brown <david...@hesbynett.no> writes:
> > >> > [...]
> > >> >> I also wonder why the committee choose to make complex numbers
> > >> >> mandatory in C99, then optional in C11. Complex numbers are not
> > >> >> particularly hard to implement (once you have all the rest of floating
> > >> >> point support and <math.h>), and on the user side they are zero cost
> > >> >> if you don't use them.
> > >> >
> > >> > I had forgotten that C11 made complex numbers optional. I agree that it
> > >> > was an odd decision, as was making VLAs optional.
> > >> >
> > >> > Making a feature optional could be a good first step towards making it
> > >> > mandatory in a future edition of the standard. Making an existing
> > >> > mandatory feature optional makes less sense to me.
> > >> >
> > >> Could it have been pressure from a certain major compiler manufacturer
> > >> who has been extremely slow at implementing some C99 features, other
> > >> than those that were also part of C++ ? Perhaps they wanted to change
> > >> their reputation of being poor at C because they were far from C99
> > >> compliant, and they could now get C11 compliance with less effort.
> > >>
> > >> Or maybe that's just a conspiracy theory :-)
> > >
> > > I'd guess, that's part of the reason.
> > > The other part is desire to make 'C' maximally close to a subset of
> > > C++.
> > But then C++ has had complex numbers (alost from the get-go), so maybe
> > not!
> >
> > --
> > Ben.
> C++ complex numbers are part of template library rather than of base language.
> C99 complex numbers and C++ complex number are not merely incompatible,
> forcing them to co-exist in the same program is not easy.
> And then, we have IPP (Intel Performance Primitives) complex types to make
> things more interesting.
>
> But my previous comment had smaller scope. All I wanted to say is that
> committee likely wants to reduce the # of 'C' programs that are neither
> legal C++ nor can be turned into legal C++ programs easily by adding few casts
> [that will still keep the legal C programs].
> C99 VLA and complex numbers are by far the biggest obstacles here.

complex numbers should be implemented but not so much in c or c++ but on the cpu/assembly level

it is bcouse the basic oparation of complex number it is x,y <-> fi, R
(which uses atan2 and sqr cos and sin) is very basic and needed

i also think that cpu should have precision for trigonometry to be set up
becouse for many calculations for example when you got some x,y point
and want to rotate it on angle +fi' (which involves atan2 and sqr to convert it to fir then add fi' to fi and then use cos sin to convert it to xy) you dont need 6 or 9 digit precision when calculating this trigonometry about 4 suffice i guess and internal circuit of cpu could do such lower digit precisions much quicker i quess

there is though a problem how to expres it in language also

Re: structs passed by copy

<3d34409b-3c78-4cb9-87d4-8477de9e9008n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:5548:0:b0:3b6:37df:1efb with SMTP id o8-20020ac85548000000b003b637df1efbmr1002832qtr.416.1674564356196;
Tue, 24 Jan 2023 04:45:56 -0800 (PST)
X-Received: by 2002:a81:4e42:0:b0:506:6037:c4cc with SMTP id
c63-20020a814e42000000b005066037c4ccmr25302ywb.205.1674564355957; Tue, 24 Jan
2023 04:45:55 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!npeer.as286.net!npeer-ng0.as286.net!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 24 Jan 2023 04:45:55 -0800 (PST)
In-Reply-To: <7a94e733-dc25-4e3e-90f4-d00f4dcf9318n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.171; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.171
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com> <20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com> <tqll1e$3if0k$4@dont-email.me>
<878rhtgg7e.fsf@nosuchdomain.example.com> <tqmrp4$3p3fg$1@dont-email.me>
<d20c6408-77be-4e47-8724-91d9e2701b8bn@googlegroups.com> <878rhssteq.fsf@bsb.me.uk>
<d17c6d83-8c66-4fbd-bb22-e006e3b395efn@googlegroups.com> <7a94e733-dc25-4e3e-90f4-d00f4dcf9318n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3d34409b-3c78-4cb9-87d4-8477de9e9008n@googlegroups.com>
Subject: Re: structs passed by copy
From: profesor...@gmail.com (fir)
Injection-Date: Tue, 24 Jan 2023 12:45:56 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 6883
 by: fir - Tue, 24 Jan 2023 12:45 UTC

wtorek, 24 stycznia 2023 o 13:18:13 UTC+1 fir napisał(a):
> wtorek, 24 stycznia 2023 o 11:46:23 UTC+1 Michael S napisał(a):
> > On Tuesday, January 24, 2023 at 1:50:02 AM UTC+2, Ben Bacarisse wrote:
> > > Michael S <already...@yahoo.com> writes:
> > >
> > > > On Monday, January 23, 2023 at 10:47:45 PM UTC+2, David Brown wrote:
> > > >> On 23/01/2023 21:15, Keith Thompson wrote:
> > > >> > David Brown <david...@hesbynett.no> writes:
> > > >> > [...]
> > > >> >> I also wonder why the committee choose to make complex numbers
> > > >> >> mandatory in C99, then optional in C11. Complex numbers are not
> > > >> >> particularly hard to implement (once you have all the rest of floating
> > > >> >> point support and <math.h>), and on the user side they are zero cost
> > > >> >> if you don't use them.
> > > >> >
> > > >> > I had forgotten that C11 made complex numbers optional. I agree that it
> > > >> > was an odd decision, as was making VLAs optional.
> > > >> >
> > > >> > Making a feature optional could be a good first step towards making it
> > > >> > mandatory in a future edition of the standard. Making an existing
> > > >> > mandatory feature optional makes less sense to me.
> > > >> >
> > > >> Could it have been pressure from a certain major compiler manufacturer
> > > >> who has been extremely slow at implementing some C99 features, other
> > > >> than those that were also part of C++ ? Perhaps they wanted to change
> > > >> their reputation of being poor at C because they were far from C99
> > > >> compliant, and they could now get C11 compliance with less effort.
> > > >>
> > > >> Or maybe that's just a conspiracy theory :-)
> > > >
> > > > I'd guess, that's part of the reason.
> > > > The other part is desire to make 'C' maximally close to a subset of
> > > > C++.
> > > But then C++ has had complex numbers (alost from the get-go), so maybe
> > > not!
> > >
> > > --
> > > Ben.
> > C++ complex numbers are part of template library rather than of base language.
> > C99 complex numbers and C++ complex number are not merely incompatible,
> > forcing them to co-exist in the same program is not easy.
> > And then, we have IPP (Intel Performance Primitives) complex types to make
> > things more interesting.
> >
> > But my previous comment had smaller scope. All I wanted to say is that
> > committee likely wants to reduce the # of 'C' programs that are neither
> > legal C++ nor can be turned into legal C++ programs easily by adding few casts
> > [that will still keep the legal C programs].
> > C99 VLA and complex numbers are by far the biggest obstacles here.
> complex numbers should be implemented but not so much in c or c++ but on the cpu/assembly level
>
> it is bcouse the basic oparation of complex number it is x,y <-> fi, R
> (which uses atan2 and sqr cos and sin) is very basic and needed
>
> i also think that cpu should have precision for trigonometry to be set up
> becouse for many calculations for example when you got some x,y point
> and want to rotate it on angle +fi' (which involves atan2 and sqr to convert it to fir then add fi' to fi and then use cos sin to convert it to xy) you dont need 6 or 9 digit precision when calculating this trigonometry about 4 suffice i guess and internal circuit of cpu could do such lower digit precisions much quicker i quess
>
> there is though a problem how to expres it in language also

main problem is how to expres it in one line

i mean if you got o is a complex how to writa and read .x .y at once

p = {1,2}

{a,b}=p;

could be theoretycally used but im not sure its the best (though its also not the worst)

note if so this also rather mean that more natural function call is foo{1,2,3}
than foo(1,2,3) but round bersion looks better so maybe it suggest that
p=(1,2); (a,b)=p can be used (and maybe even p(1,2) and(a,b)p for short

its even kinda funny bcouse f(1,2,3,4) is a call with pasing and (a,b,c,d)f is a call with reting (returning) looks quite ok... [and this is stage idea how to do this complex call and et expressions when one is allowed to return more than one value, first time i seen that]

not sayin this syntax is the best as | looks tremendously good as separator,
but there it need proper decision when to use it and when not

note there is general separator that separates things in c (may be consecutive
function calls) and special separator that separates elemend of a vector/record/structure (and this separator has somewhat meaning of a gluer not separator, and maybe it would be good to use , more like separator and | more like gluer, im not sure yet though

Re: structs passed by copy

<dc558b92-b781-40f4-a456-e49439cc4901n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:1394:b0:706:50b5:abca with SMTP id k20-20020a05620a139400b0070650b5abcamr1615543qki.465.1674564860223;
Tue, 24 Jan 2023 04:54:20 -0800 (PST)
X-Received: by 2002:a81:3985:0:b0:3ef:cbd2:224d with SMTP id
g127-20020a813985000000b003efcbd2224dmr4237778ywa.459.1674564860044; Tue, 24
Jan 2023 04:54:20 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 24 Jan 2023 04:54:19 -0800 (PST)
In-Reply-To: <3d34409b-3c78-4cb9-87d4-8477de9e9008n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.171; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.171
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com> <20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com> <tqll1e$3if0k$4@dont-email.me>
<878rhtgg7e.fsf@nosuchdomain.example.com> <tqmrp4$3p3fg$1@dont-email.me>
<d20c6408-77be-4e47-8724-91d9e2701b8bn@googlegroups.com> <878rhssteq.fsf@bsb.me.uk>
<d17c6d83-8c66-4fbd-bb22-e006e3b395efn@googlegroups.com> <7a94e733-dc25-4e3e-90f4-d00f4dcf9318n@googlegroups.com>
<3d34409b-3c78-4cb9-87d4-8477de9e9008n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <dc558b92-b781-40f4-a456-e49439cc4901n@googlegroups.com>
Subject: Re: structs passed by copy
From: profesor...@gmail.com (fir)
Injection-Date: Tue, 24 Jan 2023 12:54:20 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4512
 by: fir - Tue, 24 Jan 2023 12:54 UTC

wtorek, 24 stycznia 2023 o 13:46:03 UTC+1 fir napisał(a):

> > it is bcouse the basic oparation of complex number it is x,y <-> fi, R
> > (which uses atan2 and sqr cos and sin) is very basic and needed
> >
> > i also think that cpu should have precision for trigonometry to be set up
> > becouse for many calculations for example when you got some x,y point
> > and want to rotate it on angle +fi' (which involves atan2 and sqr to convert it to fir then add fi' to fi and then use cos sin to convert it to xy) you dont need 6 or 9 digit precision when calculating this trigonometry about 4 suffice i guess and internal circuit of cpu could do such lower digit precisions much quicker i quess
> >
> > there is though a problem how to expres it in language also
> main problem is how to expres it in one line
>
> i mean if you got o is a complex how to writa and read .x .y at once
>
> p = {1,2}
>
> {a,b}=p;
>
> could be theoretycally used but im not sure its the best (though its also not the worst)
>
> note if so this also rather mean that more natural function call is foo{1,2,3}
> than foo(1,2,3) but round bersion looks better so maybe it suggest that
> p=(1,2); (a,b)=p can be used (and maybe even p(1,2) and(a,b)p for short
>
> its even kinda funny bcouse f(1,2,3,4) is a call with pasing and (a,b,c,d)f is a call with reting (returning) looks quite ok... [and this is stage idea how to do this complex call and et expressions when one is allowed to return more than one value, first time i seen that]
>
> not sayin this syntax is the best as | looks tremendously good as separator,
> but there it need proper decision when to use it and when not
>
> note there is general separator that separates things in c (may be consecutive
> function calls) and special separator that separates elemend of a vector/record/structure (and this separator has somewhat meaning of a gluer not separator, and maybe it would be good to use , more like separator and | more like gluer, im not sure yet though

this obviously looks kinda good and as i said probbaly resolves some of my syntax problems

interesting is a(b) and (a)b becouse it is like the same a takes value from b, but a(b) means a is fired than takes valueof b which then is fired , and (a)b means b is fired then pases its value to a (which then can also be fired)..this is nice imo

Re: structs passed by copy

<873580rsz7.fsf@bsb.me.uk>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: structs passed by copy
Date: Tue, 24 Jan 2023 12:56:44 +0000
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <873580rsz7.fsf@bsb.me.uk>
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com>
<20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com>
<tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com>
<tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com>
<tqll1e$3if0k$4@dont-email.me>
<878rhtgg7e.fsf@nosuchdomain.example.com>
<tqmrp4$3p3fg$1@dont-email.me>
<d20c6408-77be-4e47-8724-91d9e2701b8bn@googlegroups.com>
<878rhssteq.fsf@bsb.me.uk>
<d17c6d83-8c66-4fbd-bb22-e006e3b395efn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="ccfbb7ff8af90e61c425cefb4c2c8317";
logging-data="161550"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+IW13whuGylY4QSJbpiA4miTF5YtGKNWI="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:pQY2w/mqcP7gL2dLRBO+M5LVWuA=
sha1:IV4lRtKBxLqgDxNhHK4rmHYhbDQ=
X-BSB-Auth: 1.27c98a4fd3128791718e.20230124125644GMT.873580rsz7.fsf@bsb.me.uk
 by: Ben Bacarisse - Tue, 24 Jan 2023 12:56 UTC

Michael S <already5chosen@yahoo.com> writes:

> On Tuesday, January 24, 2023 at 1:50:02 AM UTC+2, Ben Bacarisse wrote:
>> Michael S <already...@yahoo.com> writes:
>>
>> > On Monday, January 23, 2023 at 10:47:45 PM UTC+2, David Brown wrote:
>> >> On 23/01/2023 21:15, Keith Thompson wrote:
>> >> > David Brown <david...@hesbynett.no> writes:
>> >> > [...]
>> >> >> I also wonder why the committee choose to make complex numbers
>> >> >> mandatory in C99, then optional in C11. Complex numbers are not
>> >> >> particularly hard to implement (once you have all the rest of floating
>> >> >> point support and <math.h>), and on the user side they are zero cost
>> >> >> if you don't use them.
>> >> >
>> >> > I had forgotten that C11 made complex numbers optional. I agree that it
>> >> > was an odd decision, as was making VLAs optional.
>> >> >
>> >> > Making a feature optional could be a good first step towards making it
>> >> > mandatory in a future edition of the standard. Making an existing
>> >> > mandatory feature optional makes less sense to me.
>> >> >
>> >> Could it have been pressure from a certain major compiler manufacturer
>> >> who has been extremely slow at implementing some C99 features, other
>> >> than those that were also part of C++ ? Perhaps they wanted to change
>> >> their reputation of being poor at C because they were far from C99
>> >> compliant, and they could now get C11 compliance with less effort.
>> >>
>> >> Or maybe that's just a conspiracy theory :-)
>> >
>> > I'd guess, that's part of the reason.
>> > The other part is desire to make 'C' maximally close to a subset of
>> > C++.
>> But then C++ has had complex numbers (alost from the get-go), so maybe
>> not!
>
> C++ complex numbers are part of template library rather than of base language.
> C99 complex numbers and C++ complex number are not merely incompatible,
> forcing them to co-exist in the same program is not easy.
> And then, we have IPP (Intel Performance Primitives) complex types to make
> things more interesting.
>
> But my previous comment had smaller scope. All I wanted to say is that
> committee likely wants to reduce the # of 'C' programs that are neither
> legal C++ nor can be turned into legal C++ programs easily by adding few casts
> [that will still keep the legal C programs].
> C99 VLA and complex numbers are by far the biggest obstacles here.

OK, I see where you are going with this. You think that minimal
adjustment is the aim. I was thinking that some class of programs using
C's complex numbers could be made valid C++ with a fee macros and an #if
or two, but it's been years since I wrote any such code and, anyway, you
are suggesting a much narrower concept of "subset".

By the way, are you basing this suggestion on some inside information (a
paper, a private conversation...) or is it speculative?

--
Ben.

Re: structs passed by copy

<054f682d-5c1a-4238-8b98-a995a68f49edn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:4792:0:b0:3b6:3c95:7351 with SMTP id k18-20020ac84792000000b003b63c957351mr973356qtq.594.1674566790622;
Tue, 24 Jan 2023 05:26:30 -0800 (PST)
X-Received: by 2002:a25:bfc4:0:b0:80b:877c:7a56 with SMTP id
q4-20020a25bfc4000000b0080b877c7a56mr9522ybm.368.1674566790390; Tue, 24 Jan
2023 05:26:30 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 24 Jan 2023 05:26:30 -0800 (PST)
In-Reply-To: <dc558b92-b781-40f4-a456-e49439cc4901n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.178; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.178
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com> <20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com> <tqll1e$3if0k$4@dont-email.me>
<878rhtgg7e.fsf@nosuchdomain.example.com> <tqmrp4$3p3fg$1@dont-email.me>
<d20c6408-77be-4e47-8724-91d9e2701b8bn@googlegroups.com> <878rhssteq.fsf@bsb.me.uk>
<d17c6d83-8c66-4fbd-bb22-e006e3b395efn@googlegroups.com> <7a94e733-dc25-4e3e-90f4-d00f4dcf9318n@googlegroups.com>
<3d34409b-3c78-4cb9-87d4-8477de9e9008n@googlegroups.com> <dc558b92-b781-40f4-a456-e49439cc4901n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <054f682d-5c1a-4238-8b98-a995a68f49edn@googlegroups.com>
Subject: Re: structs passed by copy
From: profesor...@gmail.com (fir)
Injection-Date: Tue, 24 Jan 2023 13:26:30 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Tue, 24 Jan 2023 13:26 UTC

wtorek, 24 stycznia 2023 o 13:54:28 UTC+1 fir napisał(a):
> this obviously looks kinda good and as i said probbaly resolves some of my syntax problems
>
> interesting is a(b) and (a)b becouse it is like the same a takes value from b, but a(b) means a is fired than takes valueof b which then is fired , and (a)b means b is fired then pases its value to a (which then can also be fired)..this is nice imo

some simple confusion i got was
what that should be

a, b=c, d

or what that should be

a b c

doeas todays conclusion say something on that? maybe..

the forst should be rather (a,b)(c,d) than a,(b=c), d i guess (im not fully sure as i cant feel my brain to much sadly today so im not quite sure from which rules it outcomem, but maybe dont matter)

a b c

in turn ahoud be calls (typically a b is like a(b) so i think a b c whould rather yeild to a(b c) which is a(b(c))

a b, c in turn should rather be a(b,c) not (a b), c see above...im not quite sure at the moment from which that rule of priority outcomes but it is probably right

maybe its becouse it conforms to

p = {1,2}

which i guess is right.. if you use 1,2 it means its a gluer (structurizer) holding 1 and 2 together ..and you cant omit it becouse otherwise 1 2 would mean 1(2)
1 calls 2 so if you want skip helping syntax of = {} then whao you get p 1,2 or p=1,2 shouldnty be read otherwise than oryginal imo..this may be not maybe considered proof (that this is ok choice) but maybe it also could (probably) so it suggest me that choices shown are more like okay than not

Re: structs passed by copy

<34191d69-b8f8-4c67-b764-7382d3f0aab4n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:4117:b0:3a5:50fa:1a32 with SMTP id cc23-20020a05622a411700b003a550fa1a32mr1271555qtb.11.1674567499030;
Tue, 24 Jan 2023 05:38:19 -0800 (PST)
X-Received: by 2002:a5b:cc8:0:b0:7b2:4421:82bb with SMTP id
e8-20020a5b0cc8000000b007b2442182bbmr2688014ybr.205.1674567498844; Tue, 24
Jan 2023 05:38:18 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 24 Jan 2023 05:38:18 -0800 (PST)
In-Reply-To: <054f682d-5c1a-4238-8b98-a995a68f49edn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.178; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.178
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com> <20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com> <tqll1e$3if0k$4@dont-email.me>
<878rhtgg7e.fsf@nosuchdomain.example.com> <tqmrp4$3p3fg$1@dont-email.me>
<d20c6408-77be-4e47-8724-91d9e2701b8bn@googlegroups.com> <878rhssteq.fsf@bsb.me.uk>
<d17c6d83-8c66-4fbd-bb22-e006e3b395efn@googlegroups.com> <7a94e733-dc25-4e3e-90f4-d00f4dcf9318n@googlegroups.com>
<3d34409b-3c78-4cb9-87d4-8477de9e9008n@googlegroups.com> <dc558b92-b781-40f4-a456-e49439cc4901n@googlegroups.com>
<054f682d-5c1a-4238-8b98-a995a68f49edn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <34191d69-b8f8-4c67-b764-7382d3f0aab4n@googlegroups.com>
Subject: Re: structs passed by copy
From: profesor...@gmail.com (fir)
Injection-Date: Tue, 24 Jan 2023 13:38:19 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Tue, 24 Jan 2023 13:38 UTC

wtorek, 24 stycznia 2023 o 14:26:38 UTC+1 fir napisał(a):
> wtorek, 24 stycznia 2023 o 13:54:28 UTC+1 fir napisał(a):
> > this obviously looks kinda good and as i said probbaly resolves some of my syntax problems
> >
> > interesting is a(b) and (a)b becouse it is like the same a takes value from b, but a(b) means a is fired than takes valueof b which then is fired , and (a)b means b is fired then pases its value to a (which then can also be fired)..this is nice imo
> some simple confusion i got was
> what that should be
>
> a, b=c, d
>
> or what that should be
>
> a b c
>
> doeas todays conclusion say something on that? maybe..
>
> the forst should be rather (a,b)(c,d) than a,(b=c), d i guess (im not fully sure as i cant feel my brain to much sadly today so im not quite sure from which rules it outcomem, but maybe dont matter)
>
> a b c
>
> in turn ahoud be calls (typically a b is like a(b) so i think a b c whould rather yeild to a(b c) which is a(b(c))
>
> a b, c in turn should rather be a(b,c) not (a b), c see above...im not quite sure at the moment from which that rule of priority outcomes but it is probably right
>
> maybe its becouse it conforms to
>
> p = {1,2}
>
> which i guess is right.. if you use 1,2 it means its a gluer (structurizer) holding 1 and 2 together ..and you cant omit it becouse otherwise 1 2 would mean 1(2)
> 1 calls 2 so if you want skip helping syntax of = {} then whao you get p 1,2 or p=1,2 shouldnty be read otherwise than oryginal imo..this may be not maybe considered proof (that this is ok choice) but maybe it also could (probably) so it suggest me that choices shown are more like okay than not

hovewer some could say this yeild to some practical problem,
becouse here calling (empty space) is so favorized, then structurisation (comma) so what with just ability to put things in one line

where in my real language i compile with my furia compiler (now in state of about half basic compiler done) i use it like

void SetupCloud
{
ints cloud_x, ints cloud_y, ints cloud_z, ints cloud_r, ints cloud_color
1:200: cloud_x.add(rand2 200 1900),
cloud_y.add(rand2 2200 3500)
cloud_z.add(rand2 0 1300)
cloud_r.add(rand2 10 30)
cloud_color.add(RandColor 0 255 0 255 0 255) ;
}

so quite different to what i say

but i dont wand now to think on that yet

Re: structs passed by copy

<db5c5524-9983-41f2-9e5f-0a3903d593d6n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:5784:b0:537:4bc1:d779 with SMTP id lv4-20020a056214578400b005374bc1d779mr566480qvb.121.1674568406817;
Tue, 24 Jan 2023 05:53:26 -0800 (PST)
X-Received: by 2002:a05:6902:34f:b0:6f9:7bf9:8fc7 with SMTP id
e15-20020a056902034f00b006f97bf98fc7mr3002915ybs.279.1674568406603; Tue, 24
Jan 2023 05:53:26 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 24 Jan 2023 05:53:26 -0800 (PST)
In-Reply-To: <34191d69-b8f8-4c67-b764-7382d3f0aab4n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.178; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.178
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com> <20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com> <tqll1e$3if0k$4@dont-email.me>
<878rhtgg7e.fsf@nosuchdomain.example.com> <tqmrp4$3p3fg$1@dont-email.me>
<d20c6408-77be-4e47-8724-91d9e2701b8bn@googlegroups.com> <878rhssteq.fsf@bsb.me.uk>
<d17c6d83-8c66-4fbd-bb22-e006e3b395efn@googlegroups.com> <7a94e733-dc25-4e3e-90f4-d00f4dcf9318n@googlegroups.com>
<3d34409b-3c78-4cb9-87d4-8477de9e9008n@googlegroups.com> <dc558b92-b781-40f4-a456-e49439cc4901n@googlegroups.com>
<054f682d-5c1a-4238-8b98-a995a68f49edn@googlegroups.com> <34191d69-b8f8-4c67-b764-7382d3f0aab4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <db5c5524-9983-41f2-9e5f-0a3903d593d6n@googlegroups.com>
Subject: Re: structs passed by copy
From: profesor...@gmail.com (fir)
Injection-Date: Tue, 24 Jan 2023 13:53:26 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Tue, 24 Jan 2023 13:53 UTC

wtorek, 24 stycznia 2023 o 14:38:26 UTC+1 fir napisał(a):
> wtorek, 24 stycznia 2023 o 14:26:38 UTC+1 fir napisał(a):
> > wtorek, 24 stycznia 2023 o 13:54:28 UTC+1 fir napisał(a):
> > > this obviously looks kinda good and as i said probbaly resolves some of my syntax problems
> > >
> > > interesting is a(b) and (a)b becouse it is like the same a takes value from b, but a(b) means a is fired than takes valueof b which then is fired , and (a)b means b is fired then pases its value to a (which then can also be fired)..this is nice imo
> > some simple confusion i got was
> > what that should be
> >
> > a, b=c, d
> >
> > or what that should be
> >
> > a b c
> >
> > doeas todays conclusion say something on that? maybe..
> >
> > the forst should be rather (a,b)(c,d) than a,(b=c), d i guess (im not fully sure as i cant feel my brain to much sadly today so im not quite sure from which rules it outcomem, but maybe dont matter)
> >
> > a b c
> >
> > in turn ahoud be calls (typically a b is like a(b) so i think a b c whould rather yeild to a(b c) which is a(b(c))
> >
> > a b, c in turn should rather be a(b,c) not (a b), c see above...im not quite sure at the moment from which that rule of priority outcomes but it is probably right
> >
> > maybe its becouse it conforms to
> >
> > p = {1,2}
> >
> > which i guess is right.. if you use 1,2 it means its a gluer (structurizer) holding 1 and 2 together ..and you cant omit it becouse otherwise 1 2 would mean 1(2)
> > 1 calls 2 so if you want skip helping syntax of = {} then whao you get p 1,2 or p=1,2 shouldnty be read otherwise than oryginal imo..this may be not maybe considered proof (that this is ok choice) but maybe it also could (probably) so it suggest me that choices shown are more like okay than not
> hovewer some could say this yeild to some practical problem,
> becouse here calling (empty space) is so favorized, then structurisation (comma) so what with just ability to put things in one line
>
> where in my real language i compile with my furia compiler (now in state of about half basic compiler done) i use it like
>
> void SetupCloud
> {
> ints cloud_x, ints cloud_y, ints cloud_z, ints cloud_r, ints cloud_color
> 1:200: cloud_x.add(rand2 200 1900),
> cloud_y.add(rand2 2200 3500)
> cloud_z.add(rand2 0 1300)
> cloud_r.add(rand2 10 30)
> cloud_color.add(RandColor 0 255 0 255 0 255) ;
> }
>
> so quite different to what i say
>
> but i dont wand now to think on that yet

well overally this is maybe not much important yet becouse this is
matter of prioritizing operators (of calling structurization and separation)
underlying semantic behaviour seem to eb mostly done (probably) and
this seem most important

i probbaly need to do some experiments, it seem dor example that
if for example make rule that caling needs parenthesis and
no caling without parentesis can be done then sole space and
parenthesis may done a lot of structurisation and calling
itsef (by calling i also mean assigning bcouse = is not needed
so a lot of calling assigning and structurisation may be done
by pure spaces and parenthesis it seems so..then comma bay be add
as rough separator

Re: structs passed by copy

<34259986-2cbc-4828-ba46-a6336f081ed3n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:1007:b0:705:f3f6:717a with SMTP id z7-20020a05620a100700b00705f3f6717amr818724qkj.511.1674570048564;
Tue, 24 Jan 2023 06:20:48 -0800 (PST)
X-Received: by 2002:a81:7309:0:b0:4f9:d46b:9eff with SMTP id
o9-20020a817309000000b004f9d46b9effmr2141983ywc.92.1674570048383; Tue, 24 Jan
2023 06:20:48 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 24 Jan 2023 06:20:48 -0800 (PST)
In-Reply-To: <db5c5524-9983-41f2-9e5f-0a3903d593d6n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.216; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.216
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com> <20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com> <tqll1e$3if0k$4@dont-email.me>
<878rhtgg7e.fsf@nosuchdomain.example.com> <tqmrp4$3p3fg$1@dont-email.me>
<d20c6408-77be-4e47-8724-91d9e2701b8bn@googlegroups.com> <878rhssteq.fsf@bsb.me.uk>
<d17c6d83-8c66-4fbd-bb22-e006e3b395efn@googlegroups.com> <7a94e733-dc25-4e3e-90f4-d00f4dcf9318n@googlegroups.com>
<3d34409b-3c78-4cb9-87d4-8477de9e9008n@googlegroups.com> <dc558b92-b781-40f4-a456-e49439cc4901n@googlegroups.com>
<054f682d-5c1a-4238-8b98-a995a68f49edn@googlegroups.com> <34191d69-b8f8-4c67-b764-7382d3f0aab4n@googlegroups.com>
<db5c5524-9983-41f2-9e5f-0a3903d593d6n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <34259986-2cbc-4828-ba46-a6336f081ed3n@googlegroups.com>
Subject: Re: structs passed by copy
From: profesor...@gmail.com (fir)
Injection-Date: Tue, 24 Jan 2023 14:20:48 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 99
 by: fir - Tue, 24 Jan 2023 14:20 UTC

wtorek, 24 stycznia 2023 o 14:53:41 UTC+1 fir napisał(a):
> wtorek, 24 stycznia 2023 o 14:38:26 UTC+1 fir napisał(a):
> > wtorek, 24 stycznia 2023 o 14:26:38 UTC+1 fir napisał(a):
> > > wtorek, 24 stycznia 2023 o 13:54:28 UTC+1 fir napisał(a):
> > > > this obviously looks kinda good and as i said probbaly resolves some of my syntax problems
> > > >
> > > > interesting is a(b) and (a)b becouse it is like the same a takes value from b, but a(b) means a is fired than takes valueof b which then is fired , and (a)b means b is fired then pases its value to a (which then can also be fired)..this is nice imo
> > > some simple confusion i got was
> > > what that should be
> > >
> > > a, b=c, d
> > >
> > > or what that should be
> > >
> > > a b c
> > >
> > > doeas todays conclusion say something on that? maybe..
> > >
> > > the forst should be rather (a,b)(c,d) than a,(b=c), d i guess (im not fully sure as i cant feel my brain to much sadly today so im not quite sure from which rules it outcomem, but maybe dont matter)
> > >
> > > a b c
> > >
> > > in turn ahoud be calls (typically a b is like a(b) so i think a b c whould rather yeild to a(b c) which is a(b(c))
> > >
> > > a b, c in turn should rather be a(b,c) not (a b), c see above...im not quite sure at the moment from which that rule of priority outcomes but it is probably right
> > >
> > > maybe its becouse it conforms to
> > >
> > > p = {1,2}
> > >
> > > which i guess is right.. if you use 1,2 it means its a gluer (structurizer) holding 1 and 2 together ..and you cant omit it becouse otherwise 1 2 would mean 1(2)
> > > 1 calls 2 so if you want skip helping syntax of = {} then whao you get p 1,2 or p=1,2 shouldnty be read otherwise than oryginal imo..this may be not maybe considered proof (that this is ok choice) but maybe it also could (probably) so it suggest me that choices shown are more like okay than not
> > hovewer some could say this yeild to some practical problem,
> > becouse here calling (empty space) is so favorized, then structurisation (comma) so what with just ability to put things in one line
> >
> > where in my real language i compile with my furia compiler (now in state of about half basic compiler done) i use it like
> >
> > void SetupCloud
> > {
> > ints cloud_x, ints cloud_y, ints cloud_z, ints cloud_r, ints cloud_color
> > 1:200: cloud_x.add(rand2 200 1900),
> > cloud_y.add(rand2 2200 3500)
> > cloud_z.add(rand2 0 1300)
> > cloud_r.add(rand2 10 30)
> > cloud_color.add(RandColor 0 255 0 255 0 255) ;
> > }
> >
> > so quite different to what i say
> >
> > but i dont wand now to think on that yet
> well overally this is maybe not much important yet becouse this is
> matter of prioritizing operators (of calling structurization and separation)
> underlying semantic behaviour seem to eb mostly done (probably) and
> this seem most important
>
> i probbaly need to do some experiments, it seem dor example that
> if for example make rule that caling needs parenthesis and
> no caling without parentesis can be done then sole space and
> parenthesis may done a lot of structurisation and calling
> itsef (by calling i also mean assigning bcouse = is not needed
> so a lot of calling assigning and structurisation may be done
> by pure spaces and parenthesis it seems so..then comma bay be add
> as rough separator

it is damn sad to say

a b c

cant be a calls (call-chain) and you must write a(b(c))

but if you say it can be calls then f(a b c) cant ba a call on vector becouse a b c cant ba a vector and it must be written f(a,b,c) (or f a,b,c as i was writing)

from those two decisions (CAN and CANT ) CAN seem to be better probably
(though its not so sure becouse typically one use only 2 element call chains usually and then it get nice space based vectors f(a b(3 4) c) without a need of comma which it then can be used as separator...) but the thing that you cant write print 2 as call is aggreviating imo so probably CAN option is better
but it needs investigation (CAN option is imo more clasical)

Re: structs passed by copy

<66c0d619-a8fc-42b3-a994-835138909cd0n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:17cd:b0:3ad:3d6e:937 with SMTP id u13-20020a05622a17cd00b003ad3d6e0937mr797174qtk.459.1674572184742;
Tue, 24 Jan 2023 06:56:24 -0800 (PST)
X-Received: by 2002:a25:f08:0:b0:803:4b93:b1ce with SMTP id
8-20020a250f08000000b008034b93b1cemr967163ybp.308.1674572184533; Tue, 24 Jan
2023 06:56:24 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 24 Jan 2023 06:56:24 -0800 (PST)
In-Reply-To: <34259986-2cbc-4828-ba46-a6336f081ed3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.216; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.216
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com> <20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com> <tqll1e$3if0k$4@dont-email.me>
<878rhtgg7e.fsf@nosuchdomain.example.com> <tqmrp4$3p3fg$1@dont-email.me>
<d20c6408-77be-4e47-8724-91d9e2701b8bn@googlegroups.com> <878rhssteq.fsf@bsb.me.uk>
<d17c6d83-8c66-4fbd-bb22-e006e3b395efn@googlegroups.com> <7a94e733-dc25-4e3e-90f4-d00f4dcf9318n@googlegroups.com>
<3d34409b-3c78-4cb9-87d4-8477de9e9008n@googlegroups.com> <dc558b92-b781-40f4-a456-e49439cc4901n@googlegroups.com>
<054f682d-5c1a-4238-8b98-a995a68f49edn@googlegroups.com> <34191d69-b8f8-4c67-b764-7382d3f0aab4n@googlegroups.com>
<db5c5524-9983-41f2-9e5f-0a3903d593d6n@googlegroups.com> <34259986-2cbc-4828-ba46-a6336f081ed3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <66c0d619-a8fc-42b3-a994-835138909cd0n@googlegroups.com>
Subject: Re: structs passed by copy
From: profesor...@gmail.com (fir)
Injection-Date: Tue, 24 Jan 2023 14:56:24 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Tue, 24 Jan 2023 14:56 UTC

wtorek, 24 stycznia 2023 o 15:20:56 UTC+1 fir napisał(a):
> wtorek, 24 stycznia 2023 o 14:53:41 UTC+1 fir napisał(a):
> > wtorek, 24 stycznia 2023 o 14:38:26 UTC+1 fir napisał(a):
> > > wtorek, 24 stycznia 2023 o 14:26:38 UTC+1 fir napisał(a):
> > > > wtorek, 24 stycznia 2023 o 13:54:28 UTC+1 fir napisał(a):
> > > > > this obviously looks kinda good and as i said probbaly resolves some of my syntax problems
> > > > >
> > > > > interesting is a(b) and (a)b becouse it is like the same a takes value from b, but a(b) means a is fired than takes valueof b which then is fired , and (a)b means b is fired then pases its value to a (which then can also be fired)..this is nice imo
> > > > some simple confusion i got was
> > > > what that should be
> > > >
> > > > a, b=c, d
> > > >
> > > > or what that should be
> > > >
> > > > a b c
> > > >
> > > > doeas todays conclusion say something on that? maybe..
> > > >
> > > > the forst should be rather (a,b)(c,d) than a,(b=c), d i guess (im not fully sure as i cant feel my brain to much sadly today so im not quite sure from which rules it outcomem, but maybe dont matter)
> > > >
> > > > a b c
> > > >
> > > > in turn ahoud be calls (typically a b is like a(b) so i think a b c whould rather yeild to a(b c) which is a(b(c))
> > > >
> > > > a b, c in turn should rather be a(b,c) not (a b), c see above...im not quite sure at the moment from which that rule of priority outcomes but it is probably right
> > > >
> > > > maybe its becouse it conforms to
> > > >
> > > > p = {1,2}
> > > >
> > > > which i guess is right.. if you use 1,2 it means its a gluer (structurizer) holding 1 and 2 together ..and you cant omit it becouse otherwise 1 2 would mean 1(2)
> > > > 1 calls 2 so if you want skip helping syntax of = {} then whao you get p 1,2 or p=1,2 shouldnty be read otherwise than oryginal imo..this may be not maybe considered proof (that this is ok choice) but maybe it also could (probably) so it suggest me that choices shown are more like okay than not
> > > hovewer some could say this yeild to some practical problem,
> > > becouse here calling (empty space) is so favorized, then structurisation (comma) so what with just ability to put things in one line
> > >
> > > where in my real language i compile with my furia compiler (now in state of about half basic compiler done) i use it like
> > >
> > > void SetupCloud
> > > {
> > > ints cloud_x, ints cloud_y, ints cloud_z, ints cloud_r, ints cloud_color
> > > 1:200: cloud_x.add(rand2 200 1900),
> > > cloud_y.add(rand2 2200 3500)
> > > cloud_z.add(rand2 0 1300)
> > > cloud_r.add(rand2 10 30)
> > > cloud_color.add(RandColor 0 255 0 255 0 255) ;
> > > }
> > >
> > > so quite different to what i say
> > >
> > > but i dont wand now to think on that yet
> > well overally this is maybe not much important yet becouse this is
> > matter of prioritizing operators (of calling structurization and separation)
> > underlying semantic behaviour seem to eb mostly done (probably) and
> > this seem most important
> >
> > i probbaly need to do some experiments, it seem dor example that
> > if for example make rule that caling needs parenthesis and
> > no caling without parentesis can be done then sole space and
> > parenthesis may done a lot of structurisation and calling
> > itsef (by calling i also mean assigning bcouse = is not needed
> > so a lot of calling assigning and structurisation may be done
> > by pure spaces and parenthesis it seems so..then comma bay be add
> > as rough separator
> it is damn sad to say
>
> a b c
>
> cant be a calls (call-chain) and you must write a(b(c))
>
> but if you say it can be calls then f(a b c) cant ba a call on vector becouse a b c cant ba a vector and it must be written f(a,b,c) (or f a,b,c as i was writing)
>
> from those two decisions (CAN and CANT ) CAN seem to be better probably
> (though its not so sure becouse typically one use only 2 element call chains usually and then it get nice space based vectors f(a b(3 4) c) without a need of comma which it then can be used as separator...) but the thing that you cant write print 2 as call is aggreviating imo so probably CAN option is better
> but it needs investigation (CAN option is imo more clasical)

well in fact the option that a b,c may be treated as (a b), c may be seen as THIRD option so maybe in fact i should reconsider that too, but im a littel tired recently (feels like i cant feel the upper part of my brain, but maybe i should rest)

the third option allows a b c (as CAN version do) it also gives rough separator (as CANT version gives) it changes the meaning of a,b=3,c but maybe its not such bad, i cant compregend it fully now but probably teh way of getting to some conclusion is to slowly compare those 3 syntax scenarios then yet see if some additional will not do appear

Re: structs passed by copy

<2a1a9180-7f6d-4336-b463-fd6b8e745ad5n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:4d5a:0:b0:3b6:3a22:812c with SMTP id x26-20020ac84d5a000000b003b63a22812cmr1150591qtv.96.1674573431709;
Tue, 24 Jan 2023 07:17:11 -0800 (PST)
X-Received: by 2002:a81:4ac1:0:b0:4ec:933c:6c99 with SMTP id
x184-20020a814ac1000000b004ec933c6c99mr3247249ywa.61.1674573431525; Tue, 24
Jan 2023 07:17:11 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 24 Jan 2023 07:17:11 -0800 (PST)
In-Reply-To: <66c0d619-a8fc-42b3-a994-835138909cd0n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.216; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.216
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com> <20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com> <tqll1e$3if0k$4@dont-email.me>
<878rhtgg7e.fsf@nosuchdomain.example.com> <tqmrp4$3p3fg$1@dont-email.me>
<d20c6408-77be-4e47-8724-91d9e2701b8bn@googlegroups.com> <878rhssteq.fsf@bsb.me.uk>
<d17c6d83-8c66-4fbd-bb22-e006e3b395efn@googlegroups.com> <7a94e733-dc25-4e3e-90f4-d00f4dcf9318n@googlegroups.com>
<3d34409b-3c78-4cb9-87d4-8477de9e9008n@googlegroups.com> <dc558b92-b781-40f4-a456-e49439cc4901n@googlegroups.com>
<054f682d-5c1a-4238-8b98-a995a68f49edn@googlegroups.com> <34191d69-b8f8-4c67-b764-7382d3f0aab4n@googlegroups.com>
<db5c5524-9983-41f2-9e5f-0a3903d593d6n@googlegroups.com> <34259986-2cbc-4828-ba46-a6336f081ed3n@googlegroups.com>
<66c0d619-a8fc-42b3-a994-835138909cd0n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2a1a9180-7f6d-4336-b463-fd6b8e745ad5n@googlegroups.com>
Subject: Re: structs passed by copy
From: profesor...@gmail.com (fir)
Injection-Date: Tue, 24 Jan 2023 15:17:11 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Tue, 24 Jan 2023 15:17 UTC

wtorek, 24 stycznia 2023 o 15:56:32 UTC+1 fir napisał(a):
> >
> > from those two decisions (CAN and CANT ) CAN seem to be better probably
> > (though its not so sure becouse typically one use only 2 element call chains usually and then it get nice space based vectors f(a b(3 4) c) without a need of comma which it then can be used as separator...) but the thing that you cant write print 2 as call is aggreviating imo so probably CAN option is better
> > but it needs investigation (CAN option is imo more clasical)
> well in fact the option that a b,c may be treated as (a b), c may be seen as THIRD option so maybe in fact i should reconsider that too, but im a littel tired recently (feels like i cant feel the upper part of my brain, but maybe i should rest)
>
> the third option allows a b c (as CAN version do) it also gives rough separator (as CANT version gives) it changes the meaning of a,b=3,c but maybe its not such bad, i cant compregend it fully now but probably teh way of getting to some conclusion is to slowly compare those 3 syntax scenarios then yet see if some additional will not do appear

to sum examples

a b c
a b,c
a,b c,d

CANT: space means structurizer, comma means separator, () needed for call/assignment

CAN: space means call, comma means structurizer

THIRD: space means call, comma means separator and structurizer (if in parenthesis)

riht now i would consider CAN and THIRD as usablem CAN is good
but someone needs additional separator, THIRD gives separator
but it needs parenthesis in calls that gabe more than 1 argument
*which is maybe standalbe)

so for now maybe the third is most usable

Re: structs passed by copy

<608dba34-16c8-4012-bc3a-e4d05243e327n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:2b21:b0:709:8e:730b with SMTP id do33-20020a05620a2b2100b00709008e730bmr527804qkb.192.1674574188764;
Tue, 24 Jan 2023 07:29:48 -0800 (PST)
X-Received: by 2002:a81:3985:0:b0:3ef:cbd2:224d with SMTP id
g127-20020a813985000000b003efcbd2224dmr4313381ywa.459.1674574188571; Tue, 24
Jan 2023 07:29:48 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 24 Jan 2023 07:29:48 -0800 (PST)
In-Reply-To: <873580rsz7.fsf@bsb.me.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=199.203.251.52; posting-account=ow8VOgoAAAAfiGNvoH__Y4ADRwQF1hZW
NNTP-Posting-Host: 199.203.251.52
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com>
<tqeoet$2r8gf$1@news.xmission.com> <20230120230138.1225d36e5ad8e5f07401c67a@gmail.com>
<tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net>
<87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me>
<87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me>
<87o7qqglva.fsf@nosuchdomain.example.com> <tqll1e$3if0k$4@dont-email.me>
<878rhtgg7e.fsf@nosuchdomain.example.com> <tqmrp4$3p3fg$1@dont-email.me>
<d20c6408-77be-4e47-8724-91d9e2701b8bn@googlegroups.com> <878rhssteq.fsf@bsb.me.uk>
<d17c6d83-8c66-4fbd-bb22-e006e3b395efn@googlegroups.com> <873580rsz7.fsf@bsb.me.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <608dba34-16c8-4012-bc3a-e4d05243e327n@googlegroups.com>
Subject: Re: structs passed by copy
From: already5...@yahoo.com (Michael S)
Injection-Date: Tue, 24 Jan 2023 15:29:48 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1963
 by: Michael S - Tue, 24 Jan 2023 15:29 UTC

On Tuesday, January 24, 2023 at 2:56:59 PM UTC+2, Ben Bacarisse wrote:
> By the way, are you basing this suggestion on some inside information (a
> paper, a private conversation...) or is it speculative?
>
> --
> Ben.

the later

Re: structs passed by copy

<86bkmogc9c.fsf@linuxsc.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: structs passed by copy
Date: Tue, 24 Jan 2023 07:53:19 -0800
Organization: A noiseless patient Spider
Lines: 70
Message-ID: <86bkmogc9c.fsf@linuxsc.com>
References: <76ec6d87-0f5d-4671-b4c8-7023e3da787an@googlegroups.com> <tqeoet$2r8gf$1@news.xmission.com> <20230120230138.1225d36e5ad8e5f07401c67a@gmail.com> <tqf121$2re3i$1@news.xmission.com> <1btu0jojlm.fsf@pfeifferfamily.net> <87edrnifxn.fsf@nosuchdomain.example.com> <tqk855$386s5$2@dont-email.me> <87sfg2gszl.fsf@nosuchdomain.example.com> <tqkcal$393b1$1@dont-email.me> <87o7qqglva.fsf@nosuchdomain.example.com> <86fsc0hl4i.fsf@linuxsc.com> <87a628g440.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader01.eternal-september.org; posting-host="c6b31012a9551ab5c55cbf393aa16f93";
logging-data="215085"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19MQEPUi7HgW+eu/DMDwhib3onAd8mku1E="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:TsO400QLCWeZQZBFFfxr3xdunjE=
sha1:yXsCUOCClAMgOx4DnIvsOS9vdFA=
 by: Tim Rentsch - Tue, 24 Jan 2023 15:53 UTC

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

> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>
>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>
>> [...]
>>
>>> BTW, I was wrong about one thing: Support for _Imaginary is optional
>>> even for an implementation that predefines __STDC_IEC_559_COMPLEX__.
>>> `#ifdef _Imaginary_I` can be used to detect whether an implementation
>>> supports imaginary types.
>>
>> I don't see how you reach this conclusion. My reading of N1570 says
>> an implementation that defines __STDC_IEC_559_COMPLEX__ must have
>> imaginary types. Annex G is normative. It clearly states that an
>> implementation that defines __STDC_IEC_559_COMPLEX__ must conform to
>> its specifications. Section G.2 says _Imaginary is a keyword, and
>> there are three imaginary types, float _Imaginary, double _Imaginary,
>> and long double _Imaginary. That statement (actually a combination of
>> two statements in the annex) is a specification, and so any designated
>> implementation must conform to it.
>
> I believe you're correct, and I was wrong (the second time, not
> the first). I honestly don't know how I reached the conclusion
> that defining __STDC_IEC_559_COMPLEX__ *doesn't* imply a requirement
> to support imaginary types. Most likely I read one document while
> thinking it was a different one.
>
> I apologize for the confusion.

No apology needed.

>> In section 7.3.1, paragraph 5 says that the two macros 'imaginary' and
>> '_Imaginary_I' are defined if and only if the implementation supports
>> imaginary types, but I don't see that it gives any license to overrule
>> any other statement in the standard. Annex G is clear that there are
>> imaginary types, and the implementation must provide them. I don't
>> see any wiggle room at all. What is the reasoning behind what you
>> say above?
>
> I now think that an implementation that defines __STDC_IEC_559_COMPLEX__
> (which is optional) must support imaginary types as described in Annex G.
> The N1570 draft, of the C11 standard, and of the N3054 draft of C23
> are all consistent on this point.
>
> Both gcc and clang define __STDC_IEC_559_COMPLEX__ but do not support
> imaginary types (with command-line options to make them attempt to be
> fully conforming). I find it surprising that they would both be
> non-conforming in such a seemingly obvious way. The gcc 12.2.0 manual
> doesn't even mention the _Imaginary keyword.

What may have happened is that gcc implemented complex types
around the time of C99, when complex types were required but
Annex G was merely informative (and the last sentence of G.1
says "should conform" rather than "shall conform" as it does
in C11). As far as C99 is concerned, gcc and clang are both
conforming.

Then, when C11 came along, no one noticed the switch in status of
Annex G, and since relatively few people care about imaginary
types, no one noticed that their absence violated the rules in
the new standard. It may be the case that there are other parts
of Annex G that either gcc or clang do not satisfy, perhaps
because no one has pointed out the (possible) deficiencies.

It would be nice if some energetic person would enter a bug
report on the gcc bug list site, regarding the missing imaginary
types. I have put in gcc bug reports in the past but don't have
as much time for that now.


devel / comp.lang.c / Re: structs passed by copy

Pages:123456
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor