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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.52.120.11 with SMTP id ky11mr19584843vdb.3.1413958317542; Tue, 21 Oct 2014 23:11:57 -0700 (PDT) X-Received: by 10.140.91.4 with SMTP id y4mr4051qgd.14.1413958317480; Tue, 21 Oct 2014 23:11:57 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!dc16no4573040qab.1!news-out.google.com!i10ni97qaf.0!nntp.google.com!dc16no4573037qab.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 21 Oct 2014 23:11:57 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=93.37.248.239; posting-account=9fwclgkAAAD6oQ5usUYhee1l39geVY99 NNTP-Posting-Host: 93.37.248.239 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: passing parametars as determinants From: mockturtle Injection-Date: Wed, 22 Oct 2014 06:11:57 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2367 X-Received-Body-CRC: 635304585 Xref: news.eternal-september.org comp.lang.ada:22651 Date: 2014-10-21T23:11:57-07:00 List-Id: On Wednesday, October 22, 2014 7:12:56 AM UTC+2, comp...@gmail.com wrote: > I have task type such as... >=20 >=20 >=20 > task type myTaskType (a: Integer; b: Integer); >=20 >=20 >=20 > I have type.....=20 >=20 > type myOtherType is array (1 ..N-1) of String (1..N); >=20 > I would like to pass array of myOtherType into my task type declaration l= ike this... >=20 > task type myTaskType (a: Integer; b: Integer; c : myOtherType); ?? >=20 > Is there way to do this? As far as I know, not directly. You have two alternatives: 1. Pass c as an access to string.=20 2. Give to the task an entry point Init (or something similar) and use i= t to pass c. Something like task body myTaskType is local_copy : myOtherType; begin accept Init(c: myOtherType) do local_copy :=3D c; end Init; -- Back to serious work end myTaskType; Why are not we allowed to use generic types as discriminants? Honestly, I = do not know, I have always been curious... Note, however, that the task "p= arameters" are actually called "discriminants," so I guess they are closer = (in some sense) to the record discriminants. Riccardo