| Deutsch English Français Italiano |
|
<875xtlx44j.fsf@nosuchdomain.example.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: Named arguments in C
Date: Wed, 03 Jul 2024 19:50:04 -0700
Organization: None to speak of
Lines: 32
Message-ID: <875xtlx44j.fsf@nosuchdomain.example.com>
References: <utgjh0$21nsq$2@dont-email.me> <uth66l$266da$1@dont-email.me>
<uti83u$2ed01$4@dont-email.me> <utjhfn$2r0cr$1@dont-email.me>
<v61bbh$1n9ij$1@dont-email.me>
<pan$1e5a0$ef4a1faf$e6cedebc$3f30bac1@invalid.invalid>
<v61lm8$1p1gs$1@dont-email.me>
<pan$39bde$c80409dd$374fc6fd$c86207fe@invalid.invalid>
<v64pdt$2dlb6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Thu, 04 Jul 2024 04:50:05 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="573285f965523dbcdf6697107a2df71a";
logging-data="2720693"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FOi9zxZkE3uVM2VKJeolZ"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:ADr/NtVXFk6R36kDXmeoRbSxr8k=
sha1:9RxFlq4ud1R7GIeOx3nJB8MecUE=
Bytes: 2397
bart <bc@freeuk.com> writes:
[...]
> It really needs language support. That has been done in C for
> designated initialisers; named args are a similar feature, easier to
> implement (they can only be one level deep for example) and IMO far
> more useful.
>
> Although there are a few extra problems with C because the extra info
> needed (parameter names and default values) can appear in both the
> definition, and any number of prototype declarations, which cannot in
> conflict.
As I recall, we had this discussion here a while ago. The fact that C
allows parameter names for a function definition to differ from those in
corresponding declarations is a bit inconvenient. But what I recall
suggesting at the time is that the parameter names in a call need to be
consistent with the names in the visible declaration.
void foo(int x, int y) {
// ...
}
void foo(int xx, int yy);
foo(xx: 10, yy: 20);
See Message-ID <87pm36byty.fsf@nosuchdomain.example.com>, posted last
August.
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */