Deutsch   English   Français   Italiano  
<uvanua$27qn8$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: David Brown <david.brown@hesbynett.no>
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Fri, 12 Apr 2024 09:30:18 +0200
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <uvanua$27qn8$1@dont-email.me>
References: <uut24f$2icpb$1@dont-email.me> <uutqd2$bhl0$1@i2pn2.org>
 <uv2u2a$41j5$1@dont-email.me> <87edbestmg.fsf@bsb.me.uk>
 <uv4r9e$mdd3$1@dont-email.me> <uv5e3l$q885$1@dont-email.me>
 <uv5gfd$qum1$1@dont-email.me> <uv5lgl$s6uj$1@dont-email.me>
 <uv61f6$v1jm$1@dont-email.me> <uv68ok$11080$1@dont-email.me>
 <uv7a8n$18qf8$3@dont-email.me> <uv867l$1j8l6$1@dont-email.me>
 <_zSRN.161297$m4d.144795@fx43.iad> <20240411075825.30@kylheku.com>
 <r8TRN.114606$Wbff.54968@fx37.iad> <uva6ep$24ji7$1@dont-email.me>
 <uvah1j$26gtr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 12 Apr 2024 09:30:19 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="085f1be00dfebd806a614550c40cad96";
	logging-data="2353896"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19P2NPJktlxjp/XvxQ+FBy5GH/0nj1yl5U="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Cancel-Lock: sha1:/5ZpcwJOQCrMxWHzOG5mWjBJD44=
Content-Language: en-GB
In-Reply-To: <uvah1j$26gtr$1@dont-email.me>
Bytes: 2818

On 12/04/2024 07:32, Janis Papanagnou wrote:
> On 12.04.2024 04:31, Lawrence D'Oliveiro wrote:
>> On Thu, 11 Apr 2024 15:15:35 GMT, Scott Lurndal wrote:
>>
>>> As someone who cut his teeth on
>>> Unix V6, an empty parameter list is less self-documenting than an
>>> explicit (void).
>>
>> Should that apply when calling the function as well?
>>
>>      res = func(void);
>>
>> instead of
>>
>>      res = func();
>>
>> ?
> 
> Ideally it would be (without syntactic ballast) just
> 
>       res = func;
> 
> (as many programming languages have it designed), in
> function definition and function call; no parameters,
> no unnecessary parenthesis.
> 
> (Even Algol 68, where I've seen 'void' mentioned for
> the first time, does not use 'void' for an empty
> function argument list definition or function call.)
> 
> But we use C here, so we have to take what's given.
> 

I prefer the consistency of function calls using parenthesis.  The 
consistent alternative, found in some other languages, is that they 
never need parenthesis - "foo a b" calls "foo" with parameters "a" and "b".

(Of course you'd need some syntax for referring to the function itself, 
or its address - "fp = &foo;" would not be too onerous, IMHO.)