Deutsch English Français Italiano |
<20240903122004.0000348e@yahoo.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Michael S <already5chosen@yahoo.com> Newsgroups: comp.lang.c Subject: Re: on allowing "int a" definition everywhere Date: Tue, 3 Sep 2024 12:20:04 +0300 Organization: A noiseless patient Spider Lines: 52 Message-ID: <20240903122004.0000348e@yahoo.com> References: <afdfe7c37c6ad739fd82c7ec0587b82e0963fce2@i2pn2.org> <va3n09$3nnl8$1@dont-email.me> <f693bfded5f8fec712a445d88ebe34419e0f7072@i2pn2.org> <vajt3u$2so1b$2@dont-email.me> <7ea05965a67fa09d4ebd0b6ec53109dcb0b12f76@i2pn2.org> <3775b5abd14443f89852e05177a44bd72585cbdd@i2pn2.org> <4c7a695b1b755393162a1ae36ea6306760ffe949@i2pn2.org> <de38f0ff40f8eb2354905d74c107c507c67ba7a3@i2pn2.org> <41520456e45d778ea26805f6f711a05757365bc3@i2pn2.org> <val7m1$3374n$1@dont-email.me> <vb3bkr$1r1t9$6@dont-email.me> <vb41ut$1gbbm$1@dont-email.me> <vb64ph$37k0o$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Date: Tue, 03 Sep 2024 11:19:21 +0200 (CEST) Injection-Info: dont-email.me; posting-host="6e614ad2247dbe6491c5f283904f9720"; logging-data="3455192"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18uiLUopHVkjNahWi11/O7+/rpt9wkhQFI=" Cancel-Lock: sha1:VAcd6fDKTvWaeesK/CU31G9iM+A= X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32) Bytes: 3451 On Tue, 3 Sep 2024 04:54:10 -0000 (UTC) Lawrence D'Oliveiro <ldo@nz.invalid> wrote: > On Mon, 2 Sep 2024 10:53:33 +0100, Bart wrote: >=20 > > On 02/09/2024 04:32, Lawrence D'Oliveiro wrote: =20 > >> On Tue, 27 Aug 2024 19:59:13 +0100, Bart wrote: > >> =20 > >>> void draw_line(f32 x, y, x2, y2; u32 colour) { > >>> > >>> - Allow shared types in parameter lists ... =20 > >>=20 > >> A bit easier if you flip it around and use Pascal-style syntax: > >>=20 > >> procedure draw_line(x, y, x2, y2 : f32; colour : u32) > >>=20 > >> See how much more natural that is? =20 > >=20 > > It becomes a bit less natural when you want to initialise a > > variable at the same time, or want define a default value for a > > parameter. > >=20 > > Pascal didn't allow either of those. =20 >=20 > Ada does, with a very natural extension of the same syntax. I didn't write Ada program for many years (although probably for less years than you), but I regularly write VHDL, which syntax is heavily inspired by Ada. My experience with it can in short be summarized as "Bart is correct". VHDL declaration + initialization syntax works not too badly as long as you want to declare one signal (or constant or variable). It does not work when you try to combine declaration of two signals of the same type. It's so unnatural that I don't even know if it's at all allowed. Now, Bart seems to think that ability to combine several declarations of the same type is important. Here I disagree. At best, it's occasionally nice. > Even > allows passing arguments by keyword, too. >=20 By keyword? Do you mean call with named parameters association? > Note that even C++ has now had to allow function return types to be=20 > specified at the end of the prototype instead of up front, because > type interdependencies don=E2=80=99t work very well otherwise. Likely happened after I stopped following.