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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,772ae8afc5db35f2 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Can't export object of private type Date: 1999/03/02 Message-ID: #1/1 X-Deja-AN: 450230622 Sender: matt@mheaney.ni.net References: <7b8cvc$ii5$3@plug.news.pipex.net> NNTP-Posting-Date: Mon, 01 Mar 1999 20:09:25 PDT Newsgroups: comp.lang.ada Date: 1999-03-02T00:00:00+00:00 List-Id: nospam@thanks.com.au (Don Harrison) writes: > There is always a semantic gap between design and implementation in a > particular language. Better languages, IMO, are those where that gap > is uniformly narrow. For Ada, I think the gap is quite wide in places > (eg. polymorphic singletons) and narrow in others (eg. low-level > mapping). I disagree about the polymorphic singletons. The spec looks like this: package Singletons is type Root_Singleton_Type (<>) is abstract tagged limited null record; procedure Do_Something (Singleton : access Root_Singleton_Type) is abstract; type Singleton_Access is access all Root_Singleton_Type'Class; function Singleton return Singleton_Access; end; I wouldn't describe the semantic gap as "quite wide." The problem is that few Ada programmers have learned the limited-and-indefinite idiom. So this idiom just needs to be publicized. You can find examples of this idiom and others in the ACM patterns archive.