comp.lang.ada
 help / color / mirror / Atom feed
* Re: Access in parameters
  2001-01-05 11:49 Access in parameters Sandro Binetti
@ 2001-01-05  7:27 ` lafortg
  2001-01-05 12:39 ` n_brunot
  2001-01-05 13:42 ` Florian Weimer
  2 siblings, 0 replies; 5+ messages in thread
From: lafortg @ 2001-01-05  7:27 UTC (permalink / raw)


You're not modifying the x in parameter, your're modifying the integer
accessed via
x.

Sandro Binetti wrote:

>  Why is this correct?
>
>   type T_XXX is access all integer;
>
>   procedure PP(x:in t_xxx) is
>   begin
>     x.all:=10; -- ????
>   end pp;
>
> Can an in-access-parameter be modified inside a procedure?
>
> Thank you everybody.
>
> --
> Ciao, Sandro
>
> Sent via Deja.com
> http://www.deja.com/

--

George Lafortune
Raytheon Electronic Systems
Sudbury, Ma
e-mail: george_n_lafortune@res.raytheon.com
phone : 978-440-1423





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Access in parameters
@ 2001-01-05 11:49 Sandro Binetti
  2001-01-05  7:27 ` lafortg
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sandro Binetti @ 2001-01-05 11:49 UTC (permalink / raw)


 Why is this correct?

  type T_XXX is access all integer;

  procedure PP(x:in t_xxx) is
  begin
    x.all:=10; -- ????
  end pp;

Can an in-access-parameter be modified inside a procedure?

Thank you everybody.

--
Ciao, Sandro


Sent via Deja.com
http://www.deja.com/



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Access in parameters
  2001-01-05 11:49 Access in parameters Sandro Binetti
  2001-01-05  7:27 ` lafortg
@ 2001-01-05 12:39 ` n_brunot
  2001-01-05 13:42 ` Florian Weimer
  2 siblings, 0 replies; 5+ messages in thread
From: n_brunot @ 2001-01-05 12:39 UTC (permalink / raw)


The access parameter is not modified.
x keep the same value.
Only the pointed value x.all is changed.

In article <934cbk$9ta$1@nnrp1.deja.com>,
  Sandro Binetti <sandrobinetti@my-deja.com> wrote:
>  Why is this correct?
>
>   type T_XXX is access all integer;
>
>   procedure PP(x:in t_xxx) is
>   begin
>     x.all:=10; -- ????
>   end pp;
>
> Can an in-access-parameter be modified inside a procedure?
>
> Thank you everybody.
>
> --
> Ciao, Sandro
>
> Sent via Deja.com
> http://www.deja.com/
>


Sent via Deja.com
http://www.deja.com/



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Access in parameters
  2001-01-05 11:49 Access in parameters Sandro Binetti
  2001-01-05  7:27 ` lafortg
  2001-01-05 12:39 ` n_brunot
@ 2001-01-05 13:42 ` Florian Weimer
  2001-01-05 14:51   ` Ehud Lamm
  2 siblings, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2001-01-05 13:42 UTC (permalink / raw)


Sandro Binetti <sandrobinetti@my-deja.com> writes:

>   type T_XXX is access all integer;
> 
>   procedure PP(x:in t_xxx) is
>   begin
>     x.all:=10; -- ????
>   end pp;
> 
> Can an in-access-parameter be modified inside a procedure?

In this case, you don't modify the parameter x, but the object given
x.all.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Access in parameters
  2001-01-05 13:42 ` Florian Weimer
@ 2001-01-05 14:51   ` Ehud Lamm
  0 siblings, 0 replies; 5+ messages in thread
From: Ehud Lamm @ 2001-01-05 14:51 UTC (permalink / raw)


Compare to the definition here:

package You_cant_change_it is

   type Int_P is access constant Integer;

   X:constant Int_P;

   procedure p;

private
   Y:aliased integer:=10;
   X:constant Int_P:=Y'access;

end;

(The body however  can offer surprises:
package body You_cant_change_it is

   -------
   -- p --
   -------

   procedure p is
   begin
      Y:=Y+1;
   end p;

end You_cant_change_it;
)


--
Ehud Lamm   mslamm@mscc.huji.ac.il








^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-01-05 14:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-05 11:49 Access in parameters Sandro Binetti
2001-01-05  7:27 ` lafortg
2001-01-05 12:39 ` n_brunot
2001-01-05 13:42 ` Florian Weimer
2001-01-05 14:51   ` Ehud Lamm

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