From: GDAU100@BGUVM.BITNET ("Jonathan B. Owen")
Subject: Question about generics
Date: 29 May 89 07:02:34 GMT [thread overview]
Message-ID: <8905281734.AA24058@ajpo.sei.cmu.edu> (raw)
A while back I tried to define the following:
generic
Max_len : Integer;
package VSTR is
subtype Len_range is integer range 0..Max_len;
type V_string( len : Len_range := 0 ) is
record
data : String(1..len);
end record;
----------------------
-- VSTRING SERVICES --
----------------------
function V_string_of( str : in String ) return V_string;
Etc...
end VSTR;
The purpose of such a package is obviously to use Variable length
strings having different maximum lengths.
Using the about definition after an instantiation on Vax-Ada worked fine
(Such as "package VSTR80 is new VSTR(80)" ).
When transferring the code to Verdix Ada 3.0, on the apollo (SR 10.1),
I received a compiler warning on a variable of such a type, saying
that there is not enough storage for such a variable.
It seems that the upper limit of len_range is not considered constant...
Any ideas to overcome this difficulty?
Thank you,
JB
______________________________________________________________________________
(--) /--) /-(\ Email: gdau100@bguvm (bitnet)
\ / /--K | \|/\ /\/) /|-\ Snail: 55 Hovevei Zion
_/_/o /L__)_/o \/\__/ \X/ \_/ | |_/ Tel-Aviv, 63346 ISRAEL
(/ Jonathan B. Owen Voice: (03) 281-422
Point of view: A chicken is the means by which an egg reproduces an egg.
______________________________________________________________________________
next reply other threads:[~1989-05-29 7:02 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
1989-05-29 7:02 "Jonathan B. Owen" [this message]
-- strict thread matches above, loose matches on Subject: below --
1989-05-29 20:54 Question about generics "14827_DAVID PAPAY"
1993-08-09 21:29 question " Kenneth Anderson
1993-08-10 15:53 Robert I. Eachus
1993-08-11 0:25 agate!howland.reston.ans.net!europa.eng.gtefsd.com!darwin.sura.net!seas.g
1993-08-11 18:48 cis.ohio-state.edu!magnus.acs.ohio-state.edu!math.ohio-state.edu!howland.
1993-08-12 15:18 Robert I. Eachus
1993-09-02 17:45 Stef Van Vlierberghe
2006-07-02 16:08 Question " Peter C. Chapin
2006-07-02 18:49 ` Martin Krischik
2006-07-03 6:30 ` Jeffrey R. Carter
2006-07-03 10:33 ` Peter C. Chapin
2006-07-03 11:42 ` Jean-Pierre Rosen
2006-07-03 16:44 ` Pascal Obry
2006-07-04 1:09 ` Peter C. Chapin
2006-07-04 6:17 ` M E Leypold
2006-07-04 10:48 ` Peter C. Chapin
2006-07-03 20:03 ` Jeffrey R. Carter
2006-07-03 20:18 ` Dmitry A. Kazakov
2006-07-04 0:08 ` Randy Brukardt
2006-07-04 7:48 ` Dmitry A. Kazakov
2006-07-04 0:43 ` Jeffrey R. Carter
2006-07-03 9:46 ` Martin Krischik
2006-07-04 13:29 ` Stephen Leake
2006-07-05 12:08 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox