comp.lang.ada
 help / color / mirror / Atom feed
From: ncohen@watson.ibm.com (Norman H. Cohen)
Subject: Re: Access to subprograms
Date: 22 Mar 1995 14:56:05 GMT
Date: 1995-03-22T14:56:05+00:00	[thread overview]
Message-ID: <3kpdq5$15is@watnews1.watson.ibm.com> (raw)
In-Reply-To: FRED.95Mar20101937@play.uno

In article <FRED.95Mar20101937@play.uno>, fred@play.uno (Fred Hosch) writes: 

|> From my casual and uninformed reading of the RM, it
|> seems that something like "+"'Access is legal, even,
|> heaven forbid, for a predefined instance of "+".

It's prohibited by RM95 6.3.1, paragraphs 4, 7, and 11.  (Predefined "+"
operators have convention Intrinsic, and 'Access is prohibited for
subprograms with this convention.)  Instead, you can write

   function My_Wrapper (Left, Right: Integer) return Integer is
   begin
      return Left + Right;
   end My_Wrapper;

(or similarly for some other numeric type) and write My_Wrapper'Access.

But why "heaven forbid"?  It would have been easy for the compiler to
generate a wrapper function like this automatically and invisibly, and it
strikes me as a gratuitous nuisance to make the programmer go through the
ritual.  It also makes the language less uniform.

|> Can anyone provide a pointer?

Cute pun.

|> Thanks.

You're welcome.

--
Norman H. Cohen    ncohen@watson.ibm.com



  parent reply	other threads:[~1995-03-22 14:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-03-20 16:19 Access to subprograms Fred Hosch
1995-03-21 11:12 ` Robert Dewar
1995-03-21 14:47 ` Tucker Taft
1995-03-22 14:56 ` Norman H. Cohen [this message]
1995-03-28 16:25   ` Tucker Taft
1995-04-03  0:00     ` Sean McNeil
replies disabled

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