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,b47b15fda2aeb0b2 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Two ideas for the next Ada Standard Date: 1996/09/06 Message-ID: #1/1 X-Deja-AN: 178907758 references: <50aao3$3r88@news-s01.ny.us.ibm.net> <50jk0f$krh@goanna.cs.rmit.edu.au> <50opma$kos@goanna.cs.rmit.edu.au> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-09-06T00:00:00+00:00 List-Id: In article <50opma$kos@goanna.cs.rmit.edu.au>, Richard A. O'Keefe wrote: >That's one of the things I like about the old Russell type system: >you can derive a new type by weakening. I can say "T is integer >except that it doesn't have these operations." Yes, or perhaps, "T is Integer with only these operations". I agree that would be nice. But it would add a fair amount of complexity to the language (e.g. matching rules for generic formal types). Robert Dewar pointed out the "abstract" trick in another post. It works, but it involves a fair amount of extra mumbo-jumbo. If you want just "+" and "-" it's probably better to use a private type, in most cases. And as Robert pointed out, it only works for operators -- not other notations like literals, array indexing, membership tests, etc. >No, I'm not confused. *You* are making up this stuff about exporting >an integral type, which has no relevance to my point. OK, ok, I misunderstood you. But... >... *You* are the >one trying to export a function which will grab control over any >integral type in view, and I don't want that happening inside my >package body to stuff I have no intention of exporting, not without >my say-so. I still fail to see how a function lying around in the program library can "grab control". Functions don't normally cause calls to themselves to be inserted at other points in the code! To me, it's just like having a generic lying around -- if you don't want to use it, don't instantiate it. (Don't even "with" it, if you don't like it.) The generic is not some evil beast lying in wait, which will 'with' itself and instantiate itself upon you at inopportune times. Likewise, a function cannot cause you to call it. >Think about Beaujolais effects. I'm pretty confident that Ada 95 has no Baujolais effects. (Even though I'm not confident that I can spell "Beaujolais".) I'm not sure with absolute certainty, but I'm pretty sure. I think I understand the sort of preference rules that cause the problem, and I think we eliminated them. Also, the Language Precision Team did a formal proof. Any of this could be mistaken, but I don't think it is. Furthermore, I think I would be capable of introducing untagged class-wide types without introducing Beaujolais effects. - Bob