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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: A function that cannot be called? Date: Thu, 18 Oct 2018 21:36:00 +0200 Organization: A noiseless patient Spider Message-ID: References: <7ab688d0-b6b8-459c-b5b7-39b6c35daad2@googlegroups.com> Reply-To: nonlegitur@notmyhomepage.de Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 18 Oct 2018 19:36:11 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="1281b14f024645c2178d3ddbbc38734b"; logging-data="18085"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pCInF50H2PJZBf+FuHAcewDSvBzjJTFE=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 Cancel-Lock: sha1:bxURD81VVW3gG6LVRtQ/UybeVC8= In-Reply-To: <7ab688d0-b6b8-459c-b5b7-39b6c35daad2@googlegroups.com> Content-Language: de-DE Xref: reader02.eternal-september.org comp.lang.ada:54635 Date: 2018-10-18T21:36:00+02:00 List-Id: On 18.10.18 19:03, AdaMagica wrote: > Am Donnerstag, 18. Oktober 2018 14:14:32 UTC+2 schrieb G.B.: >> package What is >> >> type Void (<>) is private; >> >> function Impossible (X : T) return Void; >> >> private > ... >> end What; > > Of course this is possible. Declarations of objects of type Void must have an initial value, which can be provided via the "constructor" Impossible: > > X: Void := Impossible (T0); Impossible needs to return a value. But a returned object can neither be declared nor a value constructed, since type Void has an unknown discriminant so that no initial constraint can be given anywhere.