comp.lang.ada
 help / color / mirror / Atom feed
From: Hubert <herrdoktor@fumanchu.com>
Subject: Re: How to use read-only variables?
Date: Sat, 03 Jan 2015 17:50:27 -0800
Date: 2015-01-03T17:50:27-08:00	[thread overview]
Message-ID: <D%0qw.944865$UR.588338@fx04.iad> (raw)
In-Reply-To: <cgrhh9F1465U1@mid.individual.net>

Here is my guess, and I want to stress that I am by no means an Ada 
expert. So maybe it's completely wrong but here it goes anyway:

When you call that function with the IN OUT parameter, you probably make 
the mistake of thinking this is like a C++ reference, but I would think 
that the variable you use for the Access attribute is indeed a local 
one. Perhaps the compiler copies it when you call the function and then 
copies it again back when you leave the function, thus

rec.nv'Access;

would refer to a local object inside the function and the pointer would 
become invalid when you leave the function.

My guess, I would be glad if it was right :)


---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com



  reply	other threads:[~2015-01-04  1:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-04  0:58 How to use read-only variables? hreba
2015-01-04  1:50 ` Hubert [this message]
2015-01-04  2:04 ` Hubert
2015-01-04  2:33 ` Brad Moore
2015-01-04  2:55 ` Shark8
2015-01-04 12:56 ` hreba
2015-01-04 15:34   ` sbelmont700
2015-01-04 20:45   ` Brad Moore
2015-01-04 20:48     ` Brad Moore
replies disabled

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