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,9a7e0c43216f4def X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: "out" or "access" Date: 1998/10/29 Message-ID: #1/1 X-Deja-AN: 406479930 Sender: bobduff@world.std.com (Robert A Duff) References: <908956499.754394@dedale.pandemonium.fr> <70mo3h$gll$1@cf01.edf.fr> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1998-10-29T00:00:00+00:00 List-Id: Matthew Heaney writes: > Agreed. It only adds syntactic overhead, with no added value. Worse, > it makes you not pay attention to those type casts that really do > matter. Yes. The boy who cried "wolf". > Not having access constant parameters tends to cause a ripple effect, > ... I agree with your points. But how about this workaround: declare New_Iterator to take an 'in' parameter of type Root_Queue. (Presuming you really do want an iterator that can't modify the thing it's iterating over.) So it's dispatching, which you want. Inside the various overridings of it, you will normally have to do 'Unchecked_Access to produce a pointer to the thing, which you would presumably store inside the iterator object. This works because all tagged parameters are aliased. It's slightly ugly, and slightly unsafe, but at least it's fairly localized. You do have to warn your clients that they had better not let an iterator live longer that what it's iterating over. Don't you agree that this workaround is better than the ones that cause those nasty ripple effects? > We need access constant parameters. Well, we at least *want* them. - Bob -- Change robert to bob to get my real email address. Sorry.