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 22:21:10 +0200 Organization: A noiseless patient Spider Message-ID: References: Reply-To: nonlegitur@notmyhomepage.de Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 18 Oct 2018 20:21:11 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="1281b14f024645c2178d3ddbbc38734b"; logging-data="3008"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Ke+UHZCZCUE258o86u4E68ILZNrr6Jug=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 Cancel-Lock: sha1:TIzoGdGIXOUwFbK+zxFUW8ho+6o= In-Reply-To: Content-Language: de-DE Xref: reader02.eternal-september.org comp.lang.ada:54637 Date: 2018-10-18T22:21:10+02:00 List-Id: On 18.10.18 17:33, Stefan.Lucks@uni-weimar.de wrote: > On Thu, 18 Oct 2018, G.B. wrote: > >> There is a type declaration, I rememberd, in Ada, that >> does not allow any object of the type to be declared. > > What, exactly, is the point of your question? Philip Wadler asked, on occasion[*], whether there was any programming language other than Haskell that had a (concrete, usable in the normal way I guess) type like ("unihabited") Void in Data.Void. (The point is getting my feet wet at the shores of correspondences of logic, typed lambdas, and categories with resp. programming languages' features.) As a minimum, I imagine this means passing access-to-function values, each such value designating a function whose signature include type Void. Abstract functions cannot be designated, IINM, i.e., no 'Access. > [... abstract ...] > Note that objects of type Void'class can exist, but never, ever, any objects of type Void. Thus, for good reason the Ada compiler refuses to compile > >   function Impossible(X: T) return Void; So, I do want the above function to exist. I'll put the following one on the shelf, then: function Impossible (X : T) return Void is abstract; Although, the idea is, presumably, that I can use an access-to-function in some ways, but not actually call (apply) it or one of its overriding substitutes. All of this, I think, an Ada compiler will prevent when type Void is part of the signature. __ [*] Propositions as Types, Talk at Lambda Days 2016 (according to youtube)