comp.lang.ada
 help / color / mirror / Atom feed
* How to NOT give new default to parameter of generic procedure parameter?...
@ 1991-02-14 22:44 Fred Stluka
  1991-02-15 13:55 ` David Collard
  0 siblings, 1 reply; 2+ messages in thread
From: Fred Stluka @ 1991-02-14 22:44 UTC (permalink / raw)


Here's one for the language lawyers.  I don't think there is
a way to do this.  Someone please tell me that I'm wrong.

From within a generic body GEN, I want to call a procedure PROC1 
which was was passed in as a generic parameter PROC.  I want to 
make the call without specifying any parameters, allowing all of 
them to default to the default expressions specified in the 
declaration of PROC1.  I also do not want to re-specify the default
expressions in my declaration of PROC as a generic formal parameter 
to GEN, because this would override the defaults of PROC1 which may
someday be changed.

The best I've been able to do so far is to declare constants with
the values of all of the defaults, and use these constant names on
the declaration of PROC1 and on the declaration of PROC.  Then, as 
long as any future modifier of this code changes the values of the 
constants instead of changing the default values of the parameters 
directly, my generic code will still always use the right default 
values.  

Any better ideas?
--Fred

Fred Stluka                              Internet: stluka@software.org
Software Productivity Consortium         UUNET:    ...!uunet!software!stluka
2214 Rock Hill Rd, Herndon VA 22070 USA 

-- 

Fred Stluka                              Internet: stluka@software.org
Software Productivity Consortium         UUNET:    ...!uunet!software!stluka
2214 Rock Hill Rd, Herndon VA 22070 USA 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1991-02-15 13:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-02-14 22:44 How to NOT give new default to parameter of generic procedure parameter? Fred Stluka
1991-02-15 13:55 ` David Collard

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