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.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,99dc3277a0d9f273 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-15 00:17:40 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.stueberl.de!teaser.fr!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: christoph.grein@eurocopter.com Newsgroups: comp.lang.ada Subject: Re: Procedural Types Date: Wed, 15 Oct 2003 09:02:44 +0200 (MET DST) Organization: Cuivre, Argent, Or Message-ID: Reply-To: grein@egypt.otn.eurocopter.de NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1066202200 78548 80.67.180.195 (15 Oct 2003 07:16:40 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Wed, 15 Oct 2003 07:16:40 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: X-Authentication-Warning: mail.eurocopter.com: uucp set sender to using -f Content-MD5: ucEKfln+zrg2W+RID2JmTg== X-Mailer: dtmail 1.2.1 CDE Version 1.2.1 SunOS 5.6 sun4u sparc X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:883 Date: 2003-10-15T09:02:44+02:00 > Is it possible to define procedural types in ADA95 ? CLearly is it > possible to define procedure type and implement various procedures > with the same type ? Strictly speaking, there are no subprogram types (procedure and function types). Less strictly speaking, a subprogram type is defined by its parameter and return profile. So any subprogram matching the profile can e.g. be used as an actual parameter in a generic instantiation. There are also subprogram access types (pointers). Any subprogram matching the pointer profile can be assigned to such a pointer (if the access level is correct). type P_Pointer is access procedure; procedure Proc; P: P_Pointer := Proc'Access; P.all; -- call Proc type F_Pointer is access function (X: A_Type) return Another_Type; function Func (X: A_Type) return Another_Type; F: F_Pointer := Func'Access; V := F.all (X); -- call Func V := F (X); -- call Func (implecit dereference)