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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38b27bed88e97415 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-20 12:37:26 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!nntp-relay.ihug.net!ihug.co.nz!west.cox.net!cox.net!newsfeed1.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3E553C5E.7B2850FD@tsoft.com> From: Yuri X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.2 i386) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Question: Combination of Access and Constraining References: <1d13e1b4.0302200006.70207b86@posting.google.com> <9d795v0h3qa2922u8vodfhpfvprpre6ak2@4ax.com> <1d13e1b4.0302200720.9666350@posting.google.com> <3E5517AE.1040003@acm.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 20 Feb 2003 20:35:52 GMT NNTP-Posting-Host: 65.59.72.131 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1045773352 65.59.72.131 (Thu, 20 Feb 2003 12:35:52 PST) NNTP-Posting-Date: Thu, 20 Feb 2003 12:35:52 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:34301 Date: 2003-02-20T20:35:52+00:00 List-Id: Jeffrey Carter wrote: > >>function Fn (Arg : Tp) return Natural; > > > > I have to use access type here. Since this is > > simplified example. I have function accepting > > several such array arguments each of which is > > optional (null). > > This is still not a requirement to use access types. You can still say > > Null_Tp : constant Tp (1 .. 0) := (1 .. 0 => False); > > function Fn (Arg1 : Tp := Null_Tp; Arg2 : Tp := Null_Tp; ...) > return Natural; > > Here you have a function with several such array arguments, each of > which is optional, and each of which is a null array if not explicitly > specified: > > Tp1 : Tp (1 .. 10) := ...; > Tp2 : Tp (1 .. 1_000) := ...; > X : Natural; > ... > X := Fn (Tp1); -- All except Arg1 are null > X := Fn (Arg2 => Tp2); -- All except Arg2 are null > X := Fn (Tp2, Tp1); -- All except Arg1 & Arg2 are null And how efficient will be eventual comparison/argument passing code resulting from such Null_Tp constant? Is it going to be one-instruction comparison in ASM or much more? For access argument and null it probably will be just on-liner comparison and one liner passing argument. Just curious ) Yuri.