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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e676bec04de25560 X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Principle of Uniform Reference Date: 1995/04/21 Message-ID: #1/1 X-Deja-AN: 101283317 references: <1995Apr11.122050@di.epfl.ch> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1995-04-21T00:00:00+00:00 List-Id: Adam, in your discussion of uniform reference you say that you should not use constants, but instead functions, but here is a case where Ada does in fact provide uniform reference: x reference to constant x x call of function x so if you decide to later replace a constant by a function, clients do not need to be modified. of course I am assuming here that the constant is deferred so that details of its structure are appropriately hidden. The notion of using functions and procedures to abstract simple access functions is certainly a reasonable one. In GNAT, all attributes in the tree are function calls, and actually, since there are several levels of abstraction in the data structures, a simple access to the tree, say for the type of a node, requires three levels of function calls. Eventually, when we implement inlining, these three levels will disappear (but they are there today, which is why I have noted in the past that you can expect the eventual performance of the GNAT front end to be a factor of several faster than it is today).