comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: ObjectAda vs Gnat -- bugs
Date: 1997/05/21
Date: 1997-05-21T00:00:00+00:00	[thread overview]
Message-ID: <dewar.864219861@merv> (raw)
In-Reply-To: 01bc6567$02846840$LocalHost@xhv46.dial.pipex.com


iNick said

<<However, one could perhaps define a nifty little function such as:

   function Is_Parameterless_Function (Entity: Ada_Entity'Class) return
Boolean is
   begin
      return (Entity in Ada_Function and then
Parameter_Count(Ada_Subprogram(Entity)) = 0) or
             Entity in Ada_Enumeration_Literal;
   end;

It may still have to be used judiciously!

Nick.>>


Nifty indeed, but unfortunately totally irrelevant to the case that started
the discussion, since of course you can rename functions with parameters
anyway. So this does not unify anything. 

Remember that the fix is absolutely trivial here, it is just a matter of
remembering to do it! The point is though, going back to Bob Duff's
original comment, that making enumeration literals be functions for some
purposes and not others (at the implementation level, and even at the
semantic level, because these are not ordinary functions, they are for
example static), means that you have specialization to do whatever you
try. 

Just for interest, here is the fix that is now in the current version of GNAT:

         elsif Is_Entity_Name (Nam)
           and then Ekind (Entity (Nam)) = E_Enumeration_Literal
         then
            --  weird but legal, equivalent to renaming a function call.
            null;


not a big deal certainly -- interesting that no one ever ran into this
in several years of use :-)






  reply	other threads:[~1997-05-21  0:00 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-16  0:00 ObjectAda vs Gnat -- bugs Keith Thompson
1997-05-16  0:00 ` Robert A Duff
1997-05-16  0:00   ` Robert Dewar
1997-05-18  0:00     ` Nick Roberts
1997-05-19  0:00       ` Robert Dewar
1997-05-20  0:00         ` Nick Roberts
1997-05-21  0:00           ` Robert Dewar [this message]
1997-05-23  0:00   ` Stephen Leake
1997-05-24  0:00     ` Robert A Duff
1997-05-28  0:00       ` Stephen Leake
1997-05-30  0:00         ` Samuel Mize
1997-05-30  0:00         ` Robert A Duff
1997-05-30  0:00           ` Matthew Heaney
1997-05-31  0:00             ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
1997-05-30  0:00 John Walker
1997-05-19  0:00 tmoran
1997-05-19  0:00 ` Jon S Anthony
1997-05-20  0:00   ` Nick Roberts
1997-05-25  0:00     ` Tom Moran
1997-05-20  0:00   ` Jeff Carter
1997-05-15  0:00 granger
1997-05-15  0:00 ` Robert Dewar
1997-05-16  0:00   ` David L Brown
1997-05-16  0:00     ` Robert Dewar
1997-05-17  0:00       ` Tom Moran
1997-05-18  0:00         ` Jon S Anthony
1997-05-19  0:00         ` Tucker Taft
1997-05-19  0:00       ` Tom Moran
1997-05-15  0:00 ` Stephen Leake
1997-05-16  0:00   ` Tucker Taft
1997-05-16  0:00     ` Jon S Anthony
1997-05-16  0:00       ` Robert Dewar
1997-05-17  0:00         ` Jon S Anthony
1997-05-16  0:00       ` Tom Moran
1997-05-16  0:00   ` Jon S Anthony
1997-05-15  0:00 ` Samuel A. Mize
1997-05-15  0:00 ` Samuel A. Mize
1997-05-16  0:00 ` Robert A Duff
1997-05-16  0:00   ` Robert Dewar
replies disabled

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