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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9eaef25f8adbf762,start X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: access to subprogram disciminants Date: 1996/04/23 Message-ID: <4livr5$rq3@news1.delphi.com>#1/1 X-Deja-AN: 150994148 organization: Delphi Internet Services Corporation newsgroups: comp.lang.ada Date: 1996-04-23T00:00:00+00:00 List-Id: I want to declare an object with parameters, in particular, a procedure parameter. In Ada 83 I would have put the object in a generic package and used the procedure as a parameter of the package. In Ada 95 it appears I can make the object a record with a discriminant of 'access to subprogram' type. But when I try this, it always seems to run into accessibility problems. package definer is type a_s is access procedure(x:in out integer); type objects(s:a_s) is record ... end definer; with definer; package user is procedure p(x:in out integer); object:objects(p'access); .. 1) How is this supposed to be done? 2) Other than generics or discriminants of records (or tasks), what other ways are there of creating parameterized objects in Ada?