comp.lang.ada
 help / color / mirror / Atom feed
* 'private' and Privacy
@ 2009-07-08  2:48 Rick
  2009-07-08  2:48 ` stefan-lucks
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Rick @ 2009-07-08  2:48 UTC (permalink / raw)


I have never fathomed out why we declare entities in packages to be
'private' and then have to go and tell the world what is in them.  I
would assume that 'private' has something to do with 'information
hiding' yet we expose what is 'private'.

I have:

   KEYPAD_ROWS_COUNT : constant Positive := 2;
   -- The number of rows on a keypad.

   KEYPAD_COLUMNS_COUNT : constant Positive := 2;
   -- The number of columns on a keypad.

   type Keys_Type is array
     (1 .. KEYPAD_ROWS_COUNT, 1 .. KEYPAD_COLUMNS_COUNT)
   of Gtk.Key_Button_Pkg.Gtk_Key_Button_Access;
   --Intermediate, addressable storage of keys for the keypad.

I am trying to find a way to ensure that the user only addresses items
in the array in the manner I provide rather than making use of the
information clearly visible about the range of the array.  I can use
functions instead of constants to define array range values but they
have to be fully declared before I define the array - and this exposes
that which I wish to remain private (the actual range).

Isn't this a contradiction in terms, or _is_ there a way to retain
'Privacy'?
--------------------------------------------
Rick Duley
North Perth,
Western Australia
http://rickduley.webs.com
                                      .-_|\
                                     /     \
                               perth *_.-._/
                                          v
aussie : 0409 106 049
o'seas : +61 409 106 049
--------------------------------------------
"Answers are easy;
         it's asking the right questions
                             which is hard."
The Doctor (Dr Who: The Face of Evil (1977)"



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

end of thread, other threads:[~2009-07-08 15:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-08  2:48 'private' and Privacy Rick
2009-07-08  2:48 ` stefan-lucks
2009-07-08  6:51 ` Gautier write-only
2009-07-08 12:47 ` Ludovic Brenta
2009-07-08 15:25 ` (see below)

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