comp.lang.ada
 help / color / mirror / Atom feed
* An equilivant to Pascal's WITH in Ada??
@ 1991-02-04  0:00 Eric Gustafson
  0 siblings, 0 replies; only message in thread
From: Eric Gustafson @ 1991-02-04  0:00 UTC (permalink / raw)


     In the process of translating Pascal, Turbo 5.5, code to Ada, Meridan, I
and the other members of my class group found that there was no equalivent to
the pascal WITH statement.  After some discussion we could not think of any
reason why the facility would cause *bad* programming practices.  The
posibility of placing each data structure in a package and then WITH/USEing
the structure was proposed, but this then makes the structure visable to
the entire package or procedure that USEes it.  This is not the desired
effect.

     Has anyone else faced this problem, I would think this question has been
asked before now.  If so what was the method used or why would a pascal WITH
structure be undesirable in Ada.

Example ( In Pascal ):
..
Type
  PersonRec  = Record
                 Name : String;
                 Age  : Integer;
                 ID   : Integer;
               end; { PersonRec }
..
Var
  Person     : PersonRec;
..
  WITH Person do
  begin
    Name := 'Asdfg';
    Age  := 24;
    ID   := 123930;
  end; { with person }
..

Any help would be appreciated as the code we are translating makes extensive
use of this feature and we feal that ada should, bar any opposing rational,
offer this feature.

Please send replies to me personally as well as the list.  The account used
to receive mail is shared by about 20 people and some issues are inadvertantly
removed before all get a chance to read them.  Please also include my name
<Eric Gustafson> in the subject line as this is how we distinguish personal
mail for each member of the single bitnet account.

Thank's in advance,

/-----------------------------------------------------------------------------\
| <Eric Gustafson> ece490@valpo.bitnet                                       |
| --------------------------------------------------------------------------- |
| "If it makes sense, then it doesn't cost cents !"                           |
\-----------------------------------------------------------------------------/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1991-02-04  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-02-04  0:00 An equilivant to Pascal's WITH in Ada?? Eric Gustafson

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