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/04 Message-ID: #1/1 X-Deja-AN: 178426360 references: <50aao3$3r88@news-s01.ny.us.ibm.net> <50gelc$2le@goanna.cs.rmit.edu.au> <322C40B1.534A@ehs.ericsson.se> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-09-04T00:00:00+00:00 List-Id: In article , Jon S Anthony wrote: >In article <322C40B1.534A@ehs.ericsson.se> Jonas Nygren writes: >> type X1A is access X; >> type X2A is access X; >> X1P : X1A; >> X2P : X2A; >> To use X1P and X2P together often requires conversions. Actually, unless you say "access all", the conversions aren't even allowed. >If you are really this concerned about this why not just make the type >limited private? Clients can't access the state (except through the >interface) and they can't assign the things. For _clients_, it is >strictly _in_ mode. But limited is not the same thing as constant. An 'in' parameter is constant -- it cannot be modified. An 'in out' parameter of a limited type is NOT constant -- it can be changed. Saying clients can't change it (except blah blah blah) isn't much help -- the fact is it *can* be changed, and it's easy for the client to change it -- just call something in the package that owns the type. Also, what about the primitive operations of the type? The whole point of parameter modes is so that you can tell by looking at the spec, whether or not a given parameter can be changed. So, I don't buy the advice "use limited instead of access constant". - Bob