Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.lang.c Subject: Re: Recursion, Yo Date: Sat, 13 Apr 2024 00:10:25 -0000 (UTC) Organization: A noiseless patient Spider Lines: 28 Message-ID: References: <87edbestmg.fsf@bsb.me.uk> <_zSRN.161297$m4d.144795@fx43.iad> <20240411075825.30@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 13 Apr 2024 02:10:26 +0200 (CEST) Injection-Info: dont-email.me; posting-host="c07c9bb19a0975fd36cf4a2cbd5e0704"; logging-data="2764275"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/64kAN4paPLosgKVrCffls" User-Agent: Pan/0.155 (Kherson; fc5a80b8) Cancel-Lock: sha1:3v8O/0LO4MlE/mgsI+wqcZZ1R4U= Bytes: 2628 On Fri, 12 Apr 2024 15:03:08 +0200, Janis Papanagnou wrote: > Another one is that you can write (e.g. in Algol 68 or many other higher > level languages) the equivalent of - again a simple example - > > int x = 2 * pi * r > > without necessity to know whether pi is a constant, the result of a > function (calculation), the result of a function implicitly called just > once on demand, or whatever else. Conceptually as a programming language > user you want the value. In Python you can’t do this with an unqualified name, but you can with a qualified one, e.g. x = 2 * math.pi * r Which one of these might be true? * “math” is a module, and “pi” is a variable defined within it * “math” is a class, and “pi” is a variable defined within it * “math” is an instance of a class, and “pi” is a variable defined either within that instance or the class * “math” is an instance of a class, and “pi” is a “property”, which is computing a value, on demand, via an implicit method call Note that the fourth possibility does an implicit method call without argument parentheses.