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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED.Oh2LSLzxQ4+YU0Htrufc+A.user.gioia.aioe.org!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Creating several types from a base type and conversion Date: Sat, 18 Jan 2020 20:34:10 +0000 Organization: Aioe.org NNTP Server Message-ID: References: <4b0649b3-aed2-44fd-822f-d6665b9352dd@googlegroups.com> <0001HW.23D35416021671CF70000511B2EF@news.individual.net> <0001HW.23D383F80221AAB870000511B2EF@news.individual.net> NNTP-Posting-Host: Oh2LSLzxQ4+YU0Htrufc+A.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (darwin) Cancel-Lock: sha1:NLeSp9wF4TuD2HLeI2PuGk1MM80= X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader01.eternal-september.org comp.lang.ada:57880 Date: 2020-01-18T20:34:10+00:00 List-Id: "Jeffrey R. Carter" writes: > On 1/18/20 7:20 PM, Bill Findlay wrote: >> type word is mod 2**30; >> >> subtype word_shift_length is Natural range 0..30; >> >> function shift_word_left (W : word; amount : word_shift_length) >> return KDF9.word; > I don't know what KDF9.Word is, but surely you have to implement > these. Or are you saying GNAT magically implements them? It doesn't; 'with Import, convention => Intrinsic' requires the first argument to have size 8, 16, 32, or 64, and the second argument must be Natural (not a subtype of it, even if unconstrained).