Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #386751
| From | Keith Thompson <Keith.S.Thompson+u@gmail.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Named arguments in C |
| Date | 2024-07-03 19:50 -0700 |
| Organization | None to speak of |
| Message-ID | <875xtlx44j.fsf@nosuchdomain.example.com> (permalink) |
| References | (4 earlier) <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> |
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 */
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar
Named arguments in C Ivan Farlenkov <yo_99@mail.ru> - 2024-07-02 21:53 +0500
Re: Named arguments in C Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> - 2024-07-02 19:39 +0000
Re: Named arguments in C Richard Harnden <richard.nospam@gmail.invalid> - 2024-07-02 20:44 +0100
Re: Named arguments in C Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> - 2024-07-03 20:16 +0000
Re: Named arguments in C Richard Harnden <richard.nospam@gmail.invalid> - 2024-07-04 09:59 +0100
Re: Named arguments in C Kaz Kylheku <643-408-1753@kylheku.com> - 2024-07-04 09:25 +0000
Re: Named arguments in C bart <bc@freeuk.com> - 2024-07-02 20:50 +0100
Re: Named arguments in C Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-07-02 15:01 -0700
Re: Named arguments in C Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> - 2024-07-03 20:42 +0000
Re: Named arguments in C bart <bc@freeuk.com> - 2024-07-04 01:12 +0100
Re: Named arguments in C Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-07-03 19:50 -0700
Re: Named arguments in C Kaz Kylheku <643-408-1753@kylheku.com> - 2024-07-04 03:15 +0000
Re: Named arguments in C Opus <ifonly@youknew.org> - 2024-07-04 11:45 +0200
Re: Named arguments in C Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-07-03 00:17 +0000
Re: Named arguments in C Bonita Montero <Bonita.Montero@gmail.com> - 2024-07-04 13:12 +0200
Re: Named arguments in C Michael S <already5chosen@yahoo.com> - 2024-07-04 15:02 +0300
Re: Named arguments in C Michael S <already5chosen@yahoo.com> - 2024-07-04 15:36 +0300
Re: Named arguments in C bart <bc@freeuk.com> - 2024-07-04 13:49 +0100
Re: Named arguments in C Bonita Montero <Bonita.Montero@gmail.com> - 2024-07-04 15:37 +0200
Re: Named arguments in C Bonita Montero <Bonita.Montero@gmail.com> - 2024-07-04 15:38 +0200
Re: Named arguments in C bart <bc@freeuk.com> - 2024-07-04 14:39 +0100
Re: Named arguments in C Bonita Montero <Bonita.Montero@gmail.com> - 2024-07-04 15:46 +0200
csiph-web