Deutsch English Français Italiano |
<uvavfe$29dgd$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: bart <bc@freeuk.com> Newsgroups: comp.lang.c Subject: Re: Recursion, Yo Date: Fri, 12 Apr 2024 10:38:52 +0100 Organization: A noiseless patient Spider Lines: 52 Message-ID: <uvavfe$29dgd$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 11:38:54 +0200 (CEST) Injection-Info: dont-email.me; posting-host="b4e55c9728b3282b5449551fe3e50c2b"; logging-data="2405901"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19X6SceL39BI4XjrZQwPvRi" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:vS6H0Njge7h+luDCPdr7P0aGuA8= In-Reply-To: <uvah1j$26gtr$1@dont-email.me> Content-Language: en-GB Bytes: 3081 On 12/04/2024 06: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(); (What happens in Python when 'func' has multiple /optional/ parameters which have all been omitted; do you need to document them in the call to distinguish this from a call to a function which genuinely has no arguments?) >> >> ? > > 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. I used to allow 'func' to call a function with no args. Later I switched to using func() as being more informative, since just: func doesn't impart very much. Maybe it's a function call; maybe it's a goto to label 'func' (as I still allow); maybe it's a macro invocation; maybe it's just evaluating a variable 'func' then discarding the value. Using func() becomes more necessary with dynamic code; if P is a reference to a function, then what does this mean: Q := P Is this copying the reference to Q, or calling P() and copying the result? Using &P to disambiguate won't work here: that will create a reference to the reference! So F() is really doing CALL F; it's making it explicit.