comp.lang.ada
 help / color / mirror / Atom feed
From: prindle@NADC.ARPA
Subject: re: Procedures as arguments
Date: Tue, 22-Oct-85 16:39:05 EDT	[thread overview]
Date: Tue Oct 22 16:39:05 1985
Message-ID: <8510222207.AA11074@UCB-VAX> (raw)

This subject was discussed at quite some length over a year ago on this list
(you might hunt down the archives).  The gist of the discussion was that it
could be done by making the procedure that is to call another procedure 
generic, with an instantiation parameter to define the procedure to be called.
The top level calling procedure then instantiates the generic once for each
different procedure that the generic must call, then calls the proper
instantiated procedure at the proper time.  My opposition to this solution
was that if multiple procedures were to be called, multiple copies of the
generic differing only in the procedure called from within itself would be
produced.  The rebuttal to this argument was that any reasonable compiler
would handle such instantiations by simply passing a hidden argument to the
middle procedure which was the address of the final procedure to be called 
(which, of course, is what everyone wanted to do in the first place, but
couldn't figure out how to).  Now the only problem is "where is this
*reasonable* compiler?".  The ALS compiler openly admits that there is no
code sharing between instantiations of the same generic; sort of leavs the
question open, doesn't it!  Perhaps others can tell this list how their
"favorite" Ada compiler handles multiple instantiations of a generic where the
only generic parameters are functions/procedures to be called (i.e. is a
hidden parameter passed for each function, is the code fully duplicated, or
perhaps something even more exciting done?).
Frank Prindle
Prindle@NADC

             reply	other threads:[~1985-10-22 20:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1985-10-22 20:39 prindle [this message]
  -- strict thread matches above, loose matches on Subject: below --
1985-10-28 19:26 Procedures as arguments Stavros Macrakis
1985-10-22 23:02 Geoff_Mendal
1985-10-22 14:04 Walt Lazear
1985-10-24 22:16 ` Berlen_Oronzo
replies disabled

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