comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Principle of Uniform Reference
Date: 1995/04/21
Date: 1995-04-21T00:00:00+00:00	[thread overview]
Message-ID: <dewar.798439197@gnat> (raw)
In-Reply-To: D7D4zF.161@irvine.com

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).





      reply	other threads:[~1995-04-21  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <RBREWER.95Apr11025011@rwb114.rh.psu.edu>
     [not found] ` <1995Apr11.122050@di.epfl.ch>
1995-04-21  0:00   ` Principle of Uniform Reference Adam Beneschan
1995-04-21  0:00     ` Robert Dewar [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox