From: Robert A Duff on 16 Mar 2010 16:04 Adam Beneschan <adam(a)irvine.com> writes: > On Mar 16, 8:18�am, Robert A Duff <bobd...(a)shell01.TheWorld.com> > wrote: > >> > Repeat after me: "limited" is a property of a view! It's not constant for a >> > particular type! That's a common mistake that even those of us on the ARG >> > make from time-to-time. >> >> I don't understand why the definition of "by reference" is subtly >> different from the definition of "immutably limited". > > Well, for one thing, the language defines what types are "immutably > limited", but it doesn't completely define which types are "by > reference"---the implementation decides that in some cases (6.2(11)). I mean the term "by-reference type", which is (portably) defined by the RM. These are the types that are required to be passed by reference. You're right that there are some other types where the compiler gets to decide -- but I wasn't talking about those. - Bob
From: Randy Brukardt on 16 Mar 2010 19:23 "Robert A Duff" <bobduff(a)shell01.TheWorld.com> wrote in message news:wcciq8wxpkv.fsf(a)shell01.TheWorld.com... > "Randy Brukardt" <randy(a)rrsoftware.com> writes: .... >> Repeat after me: "limited" is a property of a view! It's not constant for >> a >> particular type! That's a common mistake that even those of us on the ARG >> make from time-to-time. > > I don't understand why the definition of "by reference" is subtly > different from the definition of "immutably limited". Two obvious reasons: "by-reference" predates "immutably limited" by more than 10 years, and besides there are non-limited types where are "by-reference" (non-limited tagged types). The latter also means that types with a component of a non-limited tagged type are "by-reference" as well. Finally (OK, I can't count), "by-reference" breaks privacy (thus only dynamic rules ought to depend on it; legality rules should never depend on the contents of the private part), while "immutably limited" doesn't break privacy and thus can be used in legality rules. "Immutably limited" is a direct property; it doesn't depend on type of components. The net effect is that there isn't much similarity between the two concepts, nor their use. Randy.
First
|
Prev
|
Pages: 1 2 3 4 5 6 7 Prev: Getting Up to Speed - Obj.Method; Next: AonixADT vs GNATBench - anyone tried both? |