home *** CD-ROM | disk | FTP | other *** search
/ Programmer's ROM - The Computer Language Library / programmersrom.iso / ada / misc / dstr3.cmm < prev    next >
Encoding:
Text File  |  1988-05-03  |  2.0 KB  |  54 lines

  1.      
  2.      
  3.                        Comments on Porting
  4.                       Dynamic String Package
  5.                            by WIS JPMO                
  6.                             to DEC Ada
  7.  
  8.                                                                 Tool 29 
  9.                                                                 August 20, 1985
  10.      
  11. COMPILATION
  12. -----------
  13.   The file DYN.SRC which composed the Dynamic String package was recompiled 
  14.   with a few changes.
  15.  
  16.   1.  The type "long-integer" is not available on DEC, therefore type "integer"
  17.       was substituted and type "short_integer" was used in place of type 
  18.       "integer".
  19.       
  20.   2.  INTEGER_IO and FLOAT_IO were incorporated by using the predefined 
  21.       instantiations, FLOAT_TEXT_IO and INTEGER_TEXT_IO.
  22.          
  23.   3.  The private definition of DYN_STRING for a validated compiler was to 
  24.       allow the discriminant, the string size, to change frequently.  In order
  25.       to accomplish this, a default value was required initially and each 
  26.       change was then made with a complete record assignment.  However, this
  27.       definition raised a numeric error during elaboration.  We tried this on 
  28.       VERDIX and raised the same error, VERDIX contends it is a 'bug'. 
  29.  
  30.       We later tried the following definition and had no problem. 
  31.  
  32.              subtype INDEX is positive range 1..100;
  33.              type DYN_STRING (SIZE : INDEX := 1) is private; 
  34.  
  35.              private
  36.                    type DYN_STRING (size : index := 1) is
  37.                       record
  38.                           DATA : string (1..size);
  39.                       end record;
  40.  
  41.       Note, this constrains the maximum allocation size of the string but  
  42.       still allows the string to be dynamic. 
  43.  
  44.       The original method, to be used when a validated compiler was not
  45.       available, worked fine.
  46.       
  47.       
  48.  
  49. EXECUTION
  50. ---------
  51.   We were able to execute a program that used the Dynamic String Package and 
  52.   it appeared to be in workable condition.
  53.  
  54.