Re: on allowing "int a" definition everywhere

Liste des GroupesRevenir à l c 
Sujet : Re: on allowing "int a" definition everywhere
De : already5chosen (at) *nospam* yahoo.com (Michael S)
Groupes : comp.lang.c
Date : 03. Sep 2024, 11:20:04
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240903122004.0000348e@yahoo.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
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:
 
On 02/09/2024 04:32, Lawrence D'Oliveiro wrote: 
On Tue, 27 Aug 2024 19:59:13 +0100, Bart wrote:
 
     void draw_line(f32 x, y, x2, y2; u32 colour) {
>
- Allow shared types in parameter lists ... 
 
A bit easier if you flip it around and use Pascal-style syntax:
 
     procedure draw_line(x, y, x2, y2 : f32; colour : u32)
 
See how much more natural that is? 
 
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.
 
Pascal didn't allow either of those. 
 
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.
 

By keyword? Do you mean call with named parameters association?

Note that even C++ has now had to allow function return types to be
specified at the end of the prototype instead of up front, because
type interdependencies don’t work very well otherwise.

Likely happened after I stopped following.



Date Sujet#  Auteur
20 Aug 24 * on allowing "int a" definition everywhere62fir
20 Aug 24 +* Re: on allowing "int a" definition everywhere24Thiago Adams
20 Aug 24 i+* Re: on allowing "int a" definition everywhere4fir
20 Aug 24 ii+- Re: on allowing "int a" definition everywhere1fir
20 Aug 24 ii`* Re: on allowing "int a" definition everywhere2Thiago Adams
20 Aug 24 ii `- Re: on allowing "int a" definition everywhere1fir
21 Aug 24 i`* Re: on allowing "int a" definition everywhere19Blue-Maned_Hawk
21 Aug 24 i `* Re: on allowing "int a" definition everywhere18Thiago Adams
21 Aug 24 i  +* Re: on allowing "int a" definition everywhere4Bart
21 Aug 24 i  i`* Re: on allowing "int a" definition everywhere3Thiago Adams
21 Aug 24 i  i `* Re: on allowing "int a" definition everywhere2Michael S
21 Aug 24 i  i  `- Re: on allowing "int a" definition everywhere1Thiago Adams
22 Aug 24 i  `* Re: on allowing "int a" definition everywhere13Blue-Maned_Hawk
22 Aug 24 i   +* Re: on allowing "int a" definition everywhere5Keith Thompson
22 Aug 24 i   i`* Re: on allowing "int a" definition everywhere4Ben Bacarisse
22 Aug 24 i   i +- Re: on allowing "int a" definition everywhere1Keith Thompson
22 Aug 24 i   i `* Re: on allowing "int a" definition everywhere2Kaz Kylheku
23 Aug 24 i   i  `- Re: on allowing "int a" definition everywhere1Ben Bacarisse
22 Aug 24 i   `* Re: on allowing "int a" definition everywhere7Bart
22 Aug 24 i    +* Re: on allowing "int a" definition everywhere2Thiago Adams
22 Aug 24 i    i`- Re: on allowing "int a" definition everywhere1Blue-Maned_Hawk
23 Aug 24 i    `* Re: on allowing "int a" definition everywhere4fir
23 Aug 24 i     `* Re: on allowing "int a" definition everywhere3Bart
23 Aug 24 i      `* Re: on allowing "int a" definition everywhere2fir
23 Aug 24 i       `- Re: on allowing "int a" definition everywhere1fir
21 Aug 24 `* Re: on allowing "int a" definition everywhere37Lawrence D'Oliveiro
21 Aug 24  +* Re: on allowing "int a" definition everywhere2Ben Bacarisse
21 Aug 24  i`- Re: on allowing "int a" definition everywhere1Ben Bacarisse
25 Aug 24  `* Re: on allowing "int a" definition everywhere34fir
27 Aug 24   `* Re: on allowing "int a" definition everywhere33Lawrence D'Oliveiro
27 Aug 24    +* Re: on allowing "int a" definition everywhere21fir
27 Aug 24    i`* Re: on allowing "int a" definition everywhere20fir
27 Aug 24    i `* Re: on allowing "int a" definition everywhere19fir
27 Aug 24    i  +* Re: on allowing "int a" definition everywhere3fir
27 Aug 24    i  i`* Re: on allowing "int a" definition everywhere2fir
27 Aug 24    i  i `- Re: on allowing "int a" definition everywhere1fir
27 Aug 24    i  `* Re: on allowing "int a" definition everywhere15fir
27 Aug 24    i   +* Re: on allowing "int a" definition everywhere13fir
27 Aug 24    i   i+* Re: on allowing "int a" definition everywhere9Bart
27 Aug 24    i   ii+* Re: on allowing "int a" definition everywhere3fir
27 Aug 24    i   iii`* Re: on allowing "int a" definition everywhere2fir
27 Aug 24    i   iii `- Re: on allowing "int a" definition everywhere1fir
2 Sep 24    i   ii`* Re: on allowing "int a" definition everywhere5Lawrence D'Oliveiro
2 Sep 24    i   ii `* Re: on allowing "int a" definition everywhere4Bart
3 Sep 24    i   ii  `* Re: on allowing "int a" definition everywhere3Lawrence D'Oliveiro
3 Sep 24    i   ii   +- Re: on allowing "int a" definition everywhere1Kaz Kylheku
3 Sep 24    i   ii   `- Re: on allowing "int a" definition everywhere1Michael S
27 Aug 24    i   i`* Re: on allowing "int a" definition everywhere3fir
29 Aug 24    i   i `* Re: on allowing "int a" definition everywhere2fir
29 Aug 24    i   i  `- Re: on allowing "int a" definition everywhere1fir
3 Sep 24    i   `- Re: on allowing "int a" definition everywhere1Lawrence D'Oliveiro
27 Aug 24    `* Re: on allowing "int a" definition everywhere11Blue-Maned_Hawk
28 Aug 24     `* Re: on allowing "int a" definition everywhere10Tim Rentsch
28 Aug 24      `* Re: on allowing "int a" definition everywhere9Keith Thompson
28 Aug 24       +* Re: on allowing "int a" definition everywhere2Ben Bacarisse
28 Aug 24       i`- Re: on allowing "int a" definition everywhere1Tim Rentsch
28 Aug 24       +* Re: on allowing "int a" definition everywhere2Tim Rentsch
28 Aug 24       i`- Re: on allowing "int a" definition everywhere1Keith Thompson
28 Aug 24       `* Re: on allowing "int a" definition everywhere4Tim Rentsch
28 Aug 24        +- Re: on allowing "int a" definition everywhere1David Brown
28 Aug 24        +- Re: on allowing "int a" definition everywhere1James Kuyper
28 Aug 24        `- Re: on allowing "int a" definition everywhere1Keith Thompson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal