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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7f9c4ba3b0dc13ca X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-12-14 05:59:01 PST Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!rutgers!sgigate.sgi.com!enews.sgi.com!lll-winken.llnl.gov!uwm.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!gatech!bloom-beacon.mit.edu!boulder!news.coop.net!news.den.mmc.com!iplmail.orl.mmc.com!usenet From: "Theodore E. Dennison" Newsgroups: comp.lang.ada Subject: Re: Addressing functions Date: 14 Dec 1994 13:59:01 GMT Organization: IPL InterNetNews site Message-ID: <3cmtn5$1vk@theopolis.orl.mmc.com> References: <3citrc$bb5@earth.usa.net> NNTP-Posting-Host: payday.orl.mmc.com Date: 1994-12-14T13:59:01+00:00 List-Id: In article <3citrc$bb5@earth.usa.net> wbuckley@earth (Bill Buckley) writes: > For instance if I were to have an array of subprogram addresses > A(1..2) => (1 => Print1'ADDRESS, > 2 => Print2'ADDRESS); > how could I implement the calling these functions...I have heard > from several other Ada programmers that this may not be possible. To get the same effect (but in a "safe" manner), why not do the following? : subtype Procedure_Range is 1..2; procedure A (Index : in Procedure_Range) is begin case Index is when 1 => Print1; when 2 => Print2; end case; end A; This way you are calling explicit procedures, rather than jumping to addresses containing "Lord-only-knows-what". There is a very good reason for a lot of what Ada prevents you from doing. T.E.D.