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.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,447bd1cf7a88c198 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-16 01:22:08 PST Path: supernews.google.com!sn-xit-03!supernews.com!freenix!fr.clara.net!heighliner.fr.clara.net!xfer10.netnews.com!netnews.com!cpk-news-hub1.bbnplanet.com!news.gtei.net!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: dmitry6243@my-deja.com Newsgroups: comp.lang.ada Subject: Re: Subprogram types vs. "limited access" (was Re: Do we need "Mission-Critical" software? Was: What to Do? Date: Tue, 16 Jan 2001 09:12:41 GMT Organization: Deja.com Message-ID: <9413a6$7fs$1@nnrp1.deja.com> References: <3A4F5A4A.9ABA2C4F@chicagonet.net> <3A4F759E.A7D63F3F@netwood.net> <3A50ABDF.3A8F6C0D@acm.org> <92qdnn$jfg$1@news.huji.ac.il> <3A50C371.8B7B871@home.com> <3A51EC04.91353CE7@uol.com.br> <3A529C97.2CA4777F@home.com> <3A53CB9E.EA7CF86C@uol.com.br> <3A5466DE.811D43A5@acm.org> <932aol$ikc$1@nnrp1.deja.com> <932mi6$r2k$1@trog.dera.gov.uk> <9343b1$3g5$1@nnrp1.deja.com> <934iuf$eqv$1@nnrp1.deja.com> <937kc7$ssq$1@nnrp1.deja.com> <93c0e9$4u6$1@nnrp1.deja.com> <93e33l$tfu$1@nnrp1.deja.com> <93ekmo$a14$1@nnrp1.deja.com> <93f73f$mt1$1@nnrp1.deja.com> <93fnao$49u$1@nnrp1.deja.com> <93l6ut$pvf$1@nnrp1.deja.com> <93mqhh$4gl$1@nnrp1.deja.com> <93npfn$13d$1@nnrp1.deja.com> <93q393$opo$1@nnrp1.deja.com> <93vonj$3td$1@nnrp1.deja.com> NNTP-Posting-Host: 212.79.194.99 X-Article-Creation-Date: Tue Jan 16 09:12:41 2001 GMT X-Http-User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; m18) Gecko/20001108 Netscape6/6.0 X-Http-Proxy: 1.1 x71.deja.com:80 (Squid/1.1.22) for client 212.79.194.99 X-MyDeja-Info: XMYDJUIDdmitry6243 Xref: supernews.google.com comp.lang.ada:4044 Date: 2001-01-16T09:12:41+00:00 List-Id: In article <93vonj$3td$1@nnrp1.deja.com>, mark_lundquist@my-deja.com wrote: > Ada95 defined a new kind of access type, the access-to-subprogram > type. It's a real object type with real object values, even if the > value is a pointer that denotes something other than an object. You > propose an altogether new kind of type that is unprecendented in that > it does not describe objects, but subprograms. It is so unrelated to > the concept of an object type that it doesn't seem legitimate to even > call it a type, except to make the nice syntax for declaring > subprogram parameters! The tail wagging the dog, in other words. What if I'd formally say, imagine objects of subprogram type as tasks. Each time the subprogram is called, the caller is stopped and the task continues, upon return task is stopped and the caller is resumed. Tasks are "true" Ada objects, right? > The concepts of type and object are inseparable. To have subprogram > types make sense, as a starting point you would have to make > subprograms be first-class objects (not just a new kind of parameter), > and that would be a much different language than Ada. If I correctly understand your concern, the problem is to find a suitable reason to make: X : A_Subprogram_Type; illegal (without any reference to the fact that A_Subprogram_Type is a subprogram type). Well, we could make subprogram types unconstrained. ... and what do you think about: Y : UNIVERSAL_INTEGER; Subprogram types seems to be very similar to the universal types. > Well, access-to-subprogram is here to stay in Ada, whether you like it > theoretically or not :-) :-) :-). "limited access", at least, would be > a mild extension of what we already have in Ada95. I am not against "limited access". Especially if it could be applied to all pointers. We do sometimes need pointers to subprograms. My wish is to make this necessity as marginal as possible. > In terms of the machine model, pointer to a subprogram makes sense > even if subprograms are not objects (and hence not instances of a > type). Subprograms have an address -- or a descriptor, or something > that can be used as an aliasing reference. If they don't, then they > certainly cannot be passed as a closure! (For instance, you couldn't > pass an inline subprogram or an intrinsic subprogram as a closure). Potentially, I could pass an inline subprogram by copy! (:-)) Actually this is an argument against pointers (:-)). -- Regards, Dmitry Kazakov Sent via Deja.com http://www.deja.com/