comp.lang.ada
 help / color / mirror / Atom feed
* Re: Diff between bounded and unbounded?
  2000-01-24  0:00 Diff between bounded and unbounded? MaryAnn Atkinson
  2000-01-24  0:00 ` Jeff Carter
@ 2000-01-24  0:00 ` Gisle S�lensminde
  1 sibling, 0 replies; 3+ messages in thread
From: Gisle S�lensminde @ 2000-01-24  0:00 UTC (permalink / raw)


MaryAnn Atkinson wrote:

> Thanks for the info. One more question: What is then 
> the difference between BOUNDED and UNBDOUNDED strings?

Bounded string is a generic type which must be instantiated to
a preset/compile-time maximum length, while there is no such 
upper limit for unbounded strings. They can be set to any length 
at run time, given enough RAM.

Another difference is that unbounded strings will allocate
space for itself on the heap, and will allocate more (or less)
storage as needed. This is automatic, and the language standard 
states that all memory used by unbounded strings should be automaticly
released on exit of scope and assignment. 

Bounded strings should not use pointers and dynamic allocation due to 
an implementation advice in The RM.
 
--
Gisle S�lensminde ( gisle@ii.uib.no )   

ln -s /dev/null ~/.netscape/cookies




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

* Re: Diff between bounded and unbounded?
  2000-01-24  0:00 Diff between bounded and unbounded? MaryAnn Atkinson
@ 2000-01-24  0:00 ` Jeff Carter
  2000-01-24  0:00 ` Gisle S�lensminde
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Carter @ 2000-01-24  0:00 UTC (permalink / raw)


MaryAnn Atkinson wrote:
> 
> > Fixed strings contain a constant number of characters;
> > the length of the string. Bounded strings contain a maximum
> > number of characters. The actual number of characters is also
> > available as a function. Thus a Line_Bounded_String could
> > contain from 0 to 80 characters.
> 
> Thanks for the info. One more question: What is then
> the difference between BOUNDED and UNBDOUNDED strings?

A bounded string has a fixed upper limit on the length of strings it may
contain; an unbounded string has no fixed upper limit.

It is common terminology for data structures to distinguish between
bounded and unbounded forms. The bounded form has an upper limit to its
size, and storage for that maximum size is allocated when the structure
is declared. An example would be a queue that may hold a maximum of N
elements; it would be implemented by an array of N elements.

The unbounded form has no upper limit, and storage is allocated
dynamically as needed. An unbounded queue would be implemented by
pointers and a linked list of elements, with list nodes allocated as
needed.

-- 
Jeff Carter
"Monsieur Arthur King, who has the brain of a duck, you know."
Monty Python & the Holy Grail




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

* Diff between bounded and unbounded?
@ 2000-01-24  0:00 MaryAnn Atkinson
  2000-01-24  0:00 ` Jeff Carter
  2000-01-24  0:00 ` Gisle S�lensminde
  0 siblings, 2 replies; 3+ messages in thread
From: MaryAnn Atkinson @ 2000-01-24  0:00 UTC (permalink / raw)
  To: comp.lang.ada




> Fixed strings contain a constant number of characters; 
> the length of the string. Bounded strings contain a maximum 
> number of characters. The actual number of characters is also
> available as a function. Thus a Line_Bounded_String could 
> contain from 0 to 80 characters. 

Thanks for the info. One more question: What is then 
the difference between BOUNDED and UNBDOUNDED strings?

MAA 
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com







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

end of thread, other threads:[~2000-01-24  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-24  0:00 Diff between bounded and unbounded? MaryAnn Atkinson
2000-01-24  0:00 ` Jeff Carter
2000-01-24  0:00 ` Gisle S�lensminde

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