From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Functions vs constants Date: Tue, 22 Jul 2014 09:50:56 +0200 Organization: cbb software GmbH Message-ID: <18igilt89njaa.n3uy7bzna7nx.dlg@40tude.net> References: <1967ffbb-4dfc-4fe8-ba60-a32da0fe6620@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: ot/DC7n2aCvt5pcTM4dZCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:21139 Date: 2014-07-22T09:50:56+02:00 List-Id: On Tue, 22 Jul 2014 00:06:13 -0700 (PDT), Maciej Sobczak wrote: > I think that the source of such discussion is in how we perceive the role > of a programming language. You can start with the machine and abstract it > upwards - in this approach you might realize that there are things like > registers and memory cells and a concept of variable (or constant) seems > like a valid abstraction of these physical things. In this view there is > no reason whatsoever to converge the notions of objects and subprograms, > as these represent different physical mechanisms and this representation > is well understood. > On the other hand, you can start with the concept of function as a > mathematical foundation for everything else and then try to find ways to > implement it on a physical machine. Starting with this idea you might end > up with functions and constants (and variables) as special cases of the > same thing. > > Which one is correct? Both, but they represent different engineering > cultures. I see Ada rather in the first category and I don't see any > reason to force it into the other one. No. The former is called "systems programming." The latter is 2application programming." Ada is for both, being universal programming language = for most problem spaces. > That is, please don't turn Ada into > yet another functional language, there are enough of them already and > getting lost in the crowd is certainly not what Ada needs today. I don't think this is related to functional programming, which is essentially an attempt to abstract away any computational states. However, indeed the only difference between a value and a parameterless function is one of being given vs. computed. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de