From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5d794d299ccf85ec X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: private "subtype"s Date: 2000/10/09 Message-ID: <8rt85j$hg7$1@nnrp1.deja.com>#1/1 X-Deja-AN: 679438397 References: <8rsubg$ka7$1@news-hrz.uni-duisburg.de> X-Http-Proxy: 1.0 x65.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Mon Oct 09 20:00:56 2000 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) Date: 2000-10-09T00:00:00+00:00 List-Id: In article <8rsubg$ka7$1@news-hrz.uni-duisburg.de>, sb463ba@l1-hrz.uni-duisburg.de (Georg Bauhaus) wrote: > package Whoops is -- illegal! > > subtype Constr is private; > -- [[Constr]] is constrained, but the constraints need > -- not be known outside > > private > subtype Constr is Natural range 0..99; > end Whoops; That makes a little bit of sense. After all, if the client doesn't know that Constr is a subtype of Natural, then what should the compiler do if the client tries to assign a Constr to an Integer? The most probable answer is "report an error". But if that's the case, Constr is really no better to the client than a derived type. If fact, its worse. So why not just use a derived type and be done with it? -- T.E.D. http://www.telepath.com/~dennison/Ted/TED.html Day 1 of Free Europe Sent via Deja.com http://www.deja.com/ Before you buy.