From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=BAYES_05,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!emory!gatech!mcnc!uvaarpa!software.software.org!stluka From: stluka@software.org (Fred Stluka) Newsgroups: comp.lang.ada Subject: How to NOT give new default to parameter of generic procedure parameter?... Message-ID: <1991Feb14.224435.1512@software.org> Date: 14 Feb 91 22:44:35 GMT Sender: news@software.org Reply-To: stluka@software.org (Fred Stluka) Organization: Software Productivity Consortium, Herndon, Virginia List-Id: 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