comp.lang.ada
 help / color / mirror / Atom feed
From: thoyt@DDN-WMS.ARPA (Thomas Hoyt)
Subject: Variable Length Strings...
Date: 2 Jun 89 16:19:40 GMT	[thread overview]
Message-ID: <8906021617.AA11927@ajpo.sei.cmu.edu> (raw)

In Issue #143, Jonathon B. Owen writes...
>...
>Baring the above in mind, I don't understand why the generic parameter
>Max_len should not be considered constant for the issue of determining
>the max. size.  After all, it's value is avaliable during elaboration
>time, and of course cannot change, there after.

From what I understand of your problem, it *is* a constant, just a constant
that is too big for the compiler to handle.  Max_Len is declared:

   generic
      Max_Len : Integer;
   Package (etc)...

The string range statement thus defines the variable length string to be
anywhere from 0 to Integer'Last.  This raises the possiblity that Integer'Last
length strings could be created on the fly.  This frightening implication
causes the anxiety from the compiler.

Try this in your original generic.  Put some constaints on the generic
parameter:

   generic
      Max_Len : Integer range 0..20000 := 20000;
   Package (etc)...

This does two things.  It allows for a default max variable string length
if you choose to pass in nothing for the parameter.  It also tells the
compiler that at most there will be 20000 char length strings created
dynamically.  This is a whole lot less than Integer'Last( normally around
2^32 or there abouts ) and will calm Verdix's nerves.  Of course, you can
adjust the constants accordingly.  Also there may be implimentation limits
on how big you can define dynamic objects at one time.  As always, check
your manuals.

This ought to permit you to keep the generic solution, i.e. without hard
coding string range limits into separate packages. (*Disclaimer* I do
not *sigh* have access to a Verdix compiler...as always, if this patch should 
fail, the secretary will disavow all knowledge...etc...)


******
thoyt@ddn-wms.arpa      |  "Oh no...it's written in COBOL..."
Thomas Hoyt             |  "Government Computers for Government business..."
CRC Systems, Inc., Fairfax, VA -- 703-359-9400       |  "NO FUN ALLOWED..."
******

             reply	other threads:[~1989-06-02 16:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1989-06-02 16:19 Thomas Hoyt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-10-21 17:52 variable lenght strings fabio de francesco
2004-10-22  7:25 ` Martin Krischik
2004-10-22 11:11   ` Martin Dowie
2004-10-24 15:43     ` Martin Krischik
2004-10-24 18:37       ` Björn Persson
2004-10-25  7:30         ` Martin Krischik
2004-10-26  0:06           ` Randy Brukardt
2004-10-26  8:43             ` Jean-Pierre Rosen
2004-10-26 13:15               ` Martin Krischik
2004-10-26 17:37                 ` Pascal Obry
2004-10-26 18:07                   ` Hyman Rosen
2004-10-26 20:10                     ` Pascal Obry
2004-10-27 10:26                       ` variable length strings Jacob Sparre Andersen
2004-10-27 10:39                         ` Pascal Obry
2004-10-27 11:47                         ` Larry Kilgallen
2004-10-28  7:18                           ` Jacob Sparre Andersen
2004-10-27 11:50                         ` Larry Kilgallen
     [not found]                         ` <uwtxcla1n.fsf@obry.Organization: LJK Software <PTzuwe3GsIg6@eisner.encompasserve.org>
2004-10-27 12:12                           ` Samuel Tardieu
2004-10-27 12:58                             ` Pascal Obry
2004-10-27 13:04                           ` Pascal Obry
2004-10-27 14:54                             ` Dmitry A. Kazakov
2004-10-27 16:38                               ` Pascal Obry
2004-10-28  8:14                                 ` Dmitry A. Kazakov
2004-10-28  8:49                                   ` Pascal Obry
2004-10-28  9:06                                     ` Dmitry A. Kazakov
2004-10-28 16:07                                       ` Pascal Obry
2004-10-28 22:05                                         ` Jeffrey Carter
2004-10-28 22:41                                           ` Randy Brukardt
2004-10-29  1:11                                             ` Jeffrey Carter
2004-10-29  7:42                                         ` Dmitry A. Kazakov
2004-10-28 10:31                         ` Larry Kilgallen
2004-10-26 11:18             ` variable lenght strings Marius Amado Alves
2004-10-26 12:48               ` variable length strings Larry Kilgallen
2004-10-26 16:11                 ` Warren W. Gay VE3WWG
2004-10-26 18:50                   ` Björn Persson
2004-10-26 19:46                     ` Larry Kilgallen
1989-06-04  7:03 Variable Length strings "Jonathan B. Owen"
1989-06-02 13:26 Variable Length Strings "Jonathan B. Owen"
1989-06-06 13:19 ` Paul Warren
1989-05-30 15:39 Variable length strings Thomas Hoyt
replies disabled

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