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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.52.137.69 with SMTP id qg5mr4619052vdb.5.1406012773799; Tue, 22 Jul 2014 00:06:13 -0700 (PDT) X-Received: by 10.140.105.200 with SMTP id c66mr469704qgf.4.1406012773772; Tue, 22 Jul 2014 00:06:13 -0700 (PDT) Path: border2.nntp.dca1.giganews.com!nntp.giganews.com!j15no1921355qaq.0!news-out.google.com!j6ni3315qas.0!nntp.google.com!j15no1921354qaq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 22 Jul 2014 00:06:13 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=213.108.152.51; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S NNTP-Posting-Host: 213.108.152.51 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <1967ffbb-4dfc-4fe8-ba60-a32da0fe6620@googlegroups.com> Subject: Re: Functions vs constants From: Maciej Sobczak Injection-Date: Tue, 22 Jul 2014 07:06:13 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: number.nntp.dca.giganews.com comp.lang.ada:187787 Date: 2014-07-22T00:06:13-07:00 List-Id: On Monday, July 21, 2014 11:18:30 PM UTC+2, Victor Porton wrote: > Constants in a good programming language should be equivalent to argument= - > less functions which return these constants. Why? With what definition of "good"? This is like starting with arbitrary (= and subjective) assumptions. I think that the source of such discussion is in how we perceive the role o= f a programming language. You can start with the machine and abstract it up= wards - in this approach you might realize that there are things like regis= ters 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 re= present different physical mechanisms and this representation is well under= stood. On the other hand, you can start with the concept of function as a mathemat= ical 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 fun= ctions and constants (and variables) as special cases of the same thing. Which one is correct? Both, but they represent different engineering cultur= es. I see Ada rather in the first category and I don't see any reason to fo= rce it into the other one. That is, please don't turn Ada into yet another = functional language, there are enough of them already and getting lost in t= he crowd is certainly not what Ada needs today. --=20 Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com