Sujet : Re: on allowing "int a" definition everywhere
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 03. Sep 2024, 07:12:31
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240902230830.559@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-09-03, 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. Even allows
passing arguments by keyword, too.
Twit boy, "natural", in the context of languages, refers to some
combination of "extremely complicated, haphazardly evolved,
undocumented, incompletely understood, and full of ambiguities
and shifting contexts leading to miscommunication".
You don't want any whiff of the natural in any artificial language
used in computing.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca