comp.lang.ada
 help / color / mirror / Atom feed
From: wolfpack69@my-deja.com
Subject: Ada programming with Equality, Copy and Print Functions
Date: Tue, 26 Sep 2000 04:36:04 GMT
Date: 2000-09-26T04:36:04+00:00	[thread overview]
Message-ID: <8qp93j$e9k$1@nnrp1.deja.com> (raw)

Hey, I was recommended to come here for some help with this problem i face.
Here it is:

The stack pacakges, Static and Dynamic, provide Stack_Type as limited private
type. Therefore i cannot use assignment or test for equality/inequality on
objects of type stack_type in the application program. The procedures i have
worked out below, can only operate on stack objects through the operations
provided by the ADT package.

PROCEDURES:  procedure Equal(Stack_1 : in out Stack_Type,  Stack_2 : in out
Stack_Type,  Stacks_equal : out Boolean);

  procedure Copy(Target_Stack : in out Stack_Type,  Source_Stack : in out
Stack_Type);

  procedure Print_Stack(A_Stack : in out Stack_Type);

I believe these procedures are correct. I am also told that they are to work
with both static and dynamic stacks, but only test with dynamic stack ADT.

The procedures will nned to change the state of stack(I believe this can be
done using Pop to remove a stack item). There will also be a temporary stack
that will be needed, where appropriate, so that the stack data can be stored
and ensure that the stacks are returned to original state.

I hope the information is sufficient enough for you to help me with.

Thanks

Adrian


Sent via Deja.com http://www.deja.com/
Before you buy.



             reply	other threads:[~2000-09-26  4:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-26  4:36 wolfpack69 [this message]
2000-09-26  0:00 ` Ada programming with Equality, Copy and Print Functions Samuel T. Harris
2000-09-26  0:00 ` Ted Dennison
replies disabled

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