Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #58238

Re: New directions in C: Default arguments

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: New directions in C: Default arguments
Date Mon, 16 Mar 2015 11:44:50 -0700
Organization None to speak of
Lines 40
Message-ID <873854234t.fsf@kst-u.example.com> (permalink)
References <me2bmi$62t$2@speranza.aioe.org> <82a53e52-cab0-491c-a593-ef36869419c3@googlegroups.com> <87mw3eo636.fsf@bsb.me.uk> <29c12da8-bb4f-482d-9266-5f51270d7579@googlegroups.com> <me4554$crh$1@dont-email.me> <329f010e-821d-4c60-813a-949094e6e3be@googlegroups.com> <8953aa43-c9e1-471e-a763-c0d4c7fcc43b@googlegroups.com> <3f5b38ce-dd98-4ba6-b7a7-0ab9e8b89d44@googlegroups.com> <14f98f84-8033-4b26-ada1-305d89491e7e@googlegroups.com> <me51nf$2ha$1@dont-email.me> <87mw3d0xcl.fsf@kst-u.example.com> <me70mb$h53$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="c77ff4d35e33d1c939d3461ebde8dd0d"; logging-data="17960"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+q/ImYZLjItcami3vXF8P6"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:qNcOrjewriZ26x+sOHu4ni6WvYw= sha1:MZpGOtYM0afxEQtdEZRmShzMbgI=
Xref csiph.com comp.lang.c:58238

Show key headers only | View raw


Martin Shobe <martin.shobe@yahoo.com> writes:
> On 3/16/2015 10:35 AM, Keith Thompson wrote:
[...]
>> Probably the simplest rule (that would not break existing code) would be
>> to make named parameters consistent with the most recent visible
>> declaration.
>
> Another simple rule would be to require that keyword parameters are
> identified explicitly in the prototype and require that those be named
> consistently.
>
> For example (using . to identify keywords as seen else thread) the
> following would all be compatible.
>
> void func(int w, int x, int .y, int .z);
> void func(int x, int w, int .y, int .z);
> void func(int, int, int .y, int .z);
> 
> However, the following would not be compatible with the above and
> would require a diagnostic if they both appeared in the same scope.
>
> void func(int w, int x, int .z, int .y);

Perhaps I've missed something in this thread, but I don't recall anyone
suggesting using the '.' notation in the function declaration, only in
calls (using a syntax similar to the existing syntax for designators in
compound literals and initializer lists).

It looks like you're making a distinction between parameters that can be
named and parameters that can't.  That doesn't strike me as useful.

Assuming the language supports named parameters in calls, how is it
useful to allow the author of a function declaration to forbid the use
of named notation for some parameters?

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

New directions in C: Default arguments jacob navia <jacob@spamsink.net> - 2015-03-14 23:11 +0100
  Re: New directions in C: Default arguments fir <profesor.fir@gmail.com> - 2015-03-14 18:17 -0700
    Re: New directions in C: Default arguments Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-03-15 11:25 +0000
      Re: New directions in C: Default arguments fir <profesor.fir@gmail.com> - 2015-03-15 07:18 -0700
        Re: New directions in C: Default arguments Bartc <bc@freeuk.com> - 2015-03-15 14:32 +0000
          Re: New directions in C: Default arguments fir <profesor.fir@gmail.com> - 2015-03-15 08:30 -0700
            Re: New directions in C: Default arguments fir <profesor.fir@gmail.com> - 2015-03-15 09:05 -0700
              Re: New directions in C: Default arguments fir <profesor.fir@gmail.com> - 2015-03-15 10:15 -0700
                Re: New directions in C: Default arguments fir <profesor.fir@gmail.com> - 2015-03-15 15:03 -0700
                Re: New directions in C: Default arguments Bartc <bc@freeuk.com> - 2015-03-15 22:40 +0000
                Re: New directions in C: Default arguments fir <profesor.fir@gmail.com> - 2015-03-15 16:04 -0700
                Re: New directions in C: Default arguments Keith Thompson <kst-u@mib.org> - 2015-03-16 08:35 -0700
                Re: New directions in C: Default arguments David Brown <david.brown@hesbynett.no> - 2015-03-16 16:45 +0100
                Re: New directions in C: Default arguments Keith Thompson <kst-u@mib.org> - 2015-03-16 11:36 -0700
                Re: New directions in C: Default arguments Philip Lantz <prl@canterey.us> - 2015-03-17 02:09 -0700
                Re: New directions in C: Default arguments Bartc <bc@freeuk.com> - 2015-03-17 12:44 +0000
                Re: New directions in C: Default arguments Philip Lantz <prl@canterey.us> - 2015-03-17 11:07 -0700
                Re: New directions in C: Default arguments Martin Shobe <martin.shobe@yahoo.com> - 2015-03-16 11:35 -0500
                Re: New directions in C: Default arguments Greg Martin <greg.at.softsprocket@dot.com> - 2015-03-16 17:07 +0000
                Re: New directions in C: Default arguments Martin Shobe <martin.shobe@yahoo.com> - 2015-03-16 12:40 -0500
                Re: New directions in C: Default arguments Bartc <bc@freeuk.com> - 2015-03-16 18:12 +0000
                Re: New directions in C: Default arguments Greg Martin <greg.at.softsprocket@dot.com> - 2015-03-16 18:30 +0000
                Re: New directions in C: Default arguments Martin Shobe <martin.shobe@yahoo.com> - 2015-03-16 13:52 -0500
                Re: New directions in C: Default arguments Greg Martin <greg.at.softsprocket@dot.com> - 2015-03-16 19:35 +0000
                Re: New directions in C: Default arguments Martin Shobe <martin.shobe@yahoo.com> - 2015-03-16 14:52 -0500
                Re: New directions in C: Default arguments Greg Martin <greg.at.softsprocket@dot.com> - 2015-03-16 20:27 +0000
                Re: New directions in C: Default arguments Bartc <bc@freeuk.com> - 2015-03-16 19:44 +0000
                Re: New directions in C: Default arguments Greg Martin <greg.at.softsprocket@dot.com> - 2015-03-16 19:55 +0000
                Re: New directions in C: Default arguments Bartc <bc@freeuk.com> - 2015-03-16 20:23 +0000
                Re: New directions in C: Default arguments Greg Martin <greg.at.softsprocket@dot.com> - 2015-03-16 20:53 +0000
                Re: New directions in C: Default arguments fir <profesor.fir@gmail.com> - 2015-03-16 14:33 -0700
                Re: New directions in C: Default arguments Keith Thompson <kst-u@mib.org> - 2015-03-16 11:44 -0700
                Re: New directions in C: Default arguments Martin Shobe <martin.shobe@yahoo.com> - 2015-03-16 13:59 -0500
  Re: New directions in C: Default arguments Bartc <bc@freeuk.com> - 2015-03-15 01:33 +0000
    Re: New directions in C: Default arguments fir <profesor.fir@gmail.com> - 2015-03-15 00:59 -0700
    Re: New directions in C: Default arguments David Brown <david.brown@hesbynett.no> - 2015-03-15 23:45 +0100
      Re: New directions in C: Default arguments fir <profesor.fir@gmail.com> - 2015-03-15 16:21 -0700
        Re: New directions in C: Default arguments David Brown <david.brown@hesbynett.no> - 2015-03-16 11:41 +0100
          Re: New directions in C: Default arguments Bartc <bc@freeuk.com> - 2015-03-16 11:13 +0000
            Re: New directions in C: Default arguments David Brown <david.brown@hesbynett.no> - 2015-03-16 13:19 +0100
              Re: New directions in C: Default arguments Bartc <bc@freeuk.com> - 2015-03-16 12:38 +0000
                Re: New directions in C: Default arguments David Brown <david.brown@hesbynett.no> - 2015-03-16 13:51 +0100
                Re: New directions in C: Default arguments Bartc <bc@freeuk.com> - 2015-03-16 13:21 +0000
                Re: New directions in C: Default arguments David Brown <david.brown@hesbynett.no> - 2015-03-16 15:12 +0100
                Re: New directions in C: Default arguments Richard Heathfield <rjh@cpax.org.uk> - 2015-03-16 14:24 +0000
                Re: New directions in C: Default arguments David Brown <david.brown@hesbynett.no> - 2015-03-16 16:09 +0100
                Re: New directions in C: Default arguments Richard Heathfield <rjh@cpax.org.uk> - 2015-03-16 18:11 +0000
                Re: New directions in C: Default arguments David Brown <david.brown@hesbynett.no> - 2015-03-17 13:23 +0100
                Re: New directions in C: Default arguments Richard Heathfield <rjh@cpax.org.uk> - 2015-03-17 12:28 +0000
                Re: New directions in C: Default arguments jacob navia <jacob@spamsink.net> - 2015-03-17 13:33 +0100
                Re: New directions in C: Default arguments fir <profesor.fir@gmail.com> - 2015-03-17 08:20 -0700
                Re: New directions in C: Default arguments fir <profesor.fir@gmail.com> - 2015-03-17 15:16 -0700
      Re: New directions in C: Default arguments jacob navia <jacob@spamsink.net> - 2015-03-16 11:38 +0100
        Re: New directions in C: Default arguments Bartc <bc@freeuk.com> - 2015-03-16 10:51 +0000
          Re: New directions in C: Default arguments raltbos@xs4all.nl (Richard Bos) - 2015-03-16 13:47 +0000
        Re: New directions in C: Default arguments David Brown <david.brown@hesbynett.no> - 2015-03-16 13:20 +0100
        Re: New directions in C: Default arguments fir <profesor.fir@gmail.com> - 2015-03-16 10:43 -0700
      Re: New directions in C: Default arguments David Brown <david.brown@hesbynett.no> - 2015-03-17 13:18 +0100
  Re: New directions in C: Default arguments bert <bert.hutchings@btinternet.com> - 2015-03-15 08:25 -0700
    Re: New directions in C: Default arguments jacob navia <jacob@spamsink.net> - 2015-03-15 18:16 +0100
  Re: New directions in C: Default arguments Michael Angelo Ravera <maravera@prodigy.net> - 2015-03-16 00:38 -0700
    Re: New directions in C: Default arguments fir <profesor.fir@gmail.com> - 2015-03-16 01:03 -0700
    Re: New directions in C: Default arguments Robert Wessel <robertwessel2@yahoo.com> - 2015-03-16 09:04 -0500
      Re: New directions in C: Default arguments Michael Angelo Ravera <maravera@prodigy.net> - 2015-03-17 00:22 -0700
        Re: New directions in C: Default arguments fir <profesor.fir@gmail.com> - 2015-03-17 01:08 -0700
          Re: New directions in C: Default arguments fir <profesor.fir@gmail.com> - 2015-03-19 01:37 -0700
            Re: New directions in C: Default arguments asetofsymbols@gmail.com - 2015-03-20 00:45 -0700
        Re: New directions in C: Default arguments Robert Wessel <robertwessel2@yahoo.com> - 2015-03-17 22:17 -0500
          Re: New directions in C: Default arguments Michael Angelo Ravera <maravera@prodigy.net> - 2015-03-18 15:55 -0700
  Re: New directions in C: Default arguments gwowen <gwowen@gmail.com> - 2015-03-16 01:07 -0700
    Re: New directions in C: Default arguments Keith Thompson <kst-u@mib.org> - 2015-03-16 08:18 -0700
      Re: New directions in C: Default arguments Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-03-16 17:35 +0000
      Definitions vs. Prototypes (Was: New directions in C: Default arguments) gazelle@shell.xmission.com (Kenny McCormack) - 2015-03-16 17:55 +0000
  Re: New directions in C: Default arguments Kaz Kylheku <kaz@kylheku.com> - 2015-03-16 20:21 +0000
    Re: New directions in C: Default arguments jacob navia <jacob@spamsink.net> - 2015-03-16 22:44 +0100

csiph-web