comp.lang.ada
 help / color / mirror / Atom feed
From: Yuri <yuri@tsoft.com>
Subject: Re: Question: Combination of Access and Constraining
Date: Thu, 20 Feb 2003 20:35:52 GMT
Date: 2003-02-20T20:35:52+00:00	[thread overview]
Message-ID: <3E553C5E.7B2850FD@tsoft.com> (raw)
In-Reply-To: 3E5517AE.1040003@acm.org

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.




  reply	other threads:[~2003-02-20 20:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-20  8:06 Question: Combination of Access and Constraining Papandopulo
2003-02-20  9:00 ` tmoran
2003-02-20  9:29 ` Dmitry A. Kazakov
2003-02-20 15:20   ` Papandopulo
2003-02-20 16:20     ` Dmitry A. Kazakov
2003-02-20 17:58     ` Jeffrey Carter
2003-02-20 20:35       ` Yuri [this message]
2003-02-21  1:21         ` Jeffrey Carter
2003-02-21 22:53           ` Yuri
2003-02-23 12:34             ` Simon Wright
2003-02-23 17:50               ` Jeffrey Carter
2003-02-23 17:55               ` John R. Strohm
2003-02-23 17:48             ` John R. Strohm
2003-02-20 13:12 ` David C. Hoos, Sr.
2003-02-20 15:00 ` Matthew Heaney
  -- strict thread matches above, loose matches on Subject: below --
2003-02-20  9:46 Grein, Christoph
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox