Thread overview | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
January 30, 2006 Oh for christ's sake | ||||
---|---|---|---|---|
| ||||
class A { this() { b = new B(); b.x = 5; // illegal } class B { protected int x; } B b; } FIX THIS. I am tired of running into this constantly. Most likely fix: in access.c, in AggregateDeclaration::isFriendOf(), add in the lines if (cd && toParent() == cd) { #if LOG printf("\this is nested in cd\n"); #endif return 1; } I don't know if that'd work for multiply-nested classes, but it's a start. The other possibility would be to check, instead if if they are declared in the same scope (with the toParent() == cd->toParent()), if they truly are in the same module. Currently, the relationship between nested and outer classes is only one-way; that is, nested classes can access outer classes' private/protected/package members, but not the other way around. |
January 30, 2006 Re: Oh for christ's sake | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | Oh? And why not for Buddha's Sake?
Seriously... I can't figure out why people like to profane the Christian deity to express their frustrations. Social programming must be the reason people do this, I guess. It's sad...
... and very annoying. There was, at one point, a gentleman's agreement to use "Bob" in such circumstances where one was absolutely unable to maintain self-control -- it was actually humorous and considerate at the same time. It's safer too... better to belittle the corporeal than the celestial.
-JJR
Jarrett Billingsley wrote:
> class A
> {
> this()
> {
> b = new B();
> b.x = 5; // illegal
> }
>
> class B
> {
> protected int x;
> }
>
> B b;
> }
>
> FIX THIS.
>
> I am tired of running into this constantly. Most likely fix: in access.c, in AggregateDeclaration::isFriendOf(), add in the lines
>
> if (cd && toParent() == cd)
> {
> #if LOG
> printf("\this is nested in cd\n");
> #endif
> return 1;
> }
>
> I don't know if that'd work for multiply-nested classes, but it's a start. The other possibility would be to check, instead if if they are declared in the same scope (with the toParent() == cd->toParent()), if they truly are in the same module.
>
> Currently, the relationship between nested and outer classes is only one-way; that is, nested classes can access outer classes' private/protected/package members, but not the other way around.
>
>
|
January 31, 2006 Re: Oh for christ's sake | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Reimer | "John Reimer" <terminal.node@gmail.com> wrote in message news:drm7o8$1556$1@digitaldaemon.com... > Oh? And why not for Buddha's Sake? And you thought it was necessary to bring this up.. why? Maybe, instead of everyone trying to be PC all the time, people shouldn't get so damn worked up over something that's become part of the public lexicon. If you're offended, look somewhere else. |
January 31, 2006 Re: Oh for christ's sake | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | "Jarrett Billingsley" <kb3ctd2@yahoo.com> wrote in message news:drm9am$182c$1@digitaldaemon.com... > "John Reimer" <terminal.node@gmail.com> wrote in message news:drm7o8$1556$1@digitaldaemon.com... >> Oh? And why not for Buddha's Sake? > > And you thought it was necessary to bring this up.. why? > > Maybe, instead of everyone trying to be PC all the time, people shouldn't get so damn worked up over something that's become part of the public lexicon. If you're offended, look somewhere else. Sorry. This isn't the place to bring this up. I'm frustrated because I've reported this damned bug umpteen times and it hasn't even gotten recognition from Walter that it's a bug. And the only thing that seems to be happening with D right now is some frilly template metaprogramming fixes. |
January 31, 2006 Re: Oh for ____ sake | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | Jarrett Billingsley wrote:
> "Jarrett Billingsley" <kb3ctd2@yahoo.com> wrote in message news:drm9am$182c$1@digitaldaemon.com...
>> "John Reimer" <terminal.node@gmail.com> wrote in message news:drm7o8$1556$1@digitaldaemon.com...
>>> Oh? And why not for Buddha's Sake?
>> And you thought it was necessary to bring this up.. why?
>>
>> Maybe, instead of everyone trying to be PC all the time, people shouldn't get so damn worked up over something that's become part of the public lexicon. If you're offended, look somewhere else.
>
> Sorry. This isn't the place to bring this up. I'm frustrated because I've reported this damned bug umpteen times and it hasn't even gotten recognition from Walter that it's a bug. And the only thing that seems to be happening with D right now is some frilly template metaprogramming fixes.
>
>
Chances are the bug will get the attention it needs as side affect of this thread. :P If it doesn't, all I can say is "wow!"
I was indeed offended by the title, such that I cared little about what the content of your post (and I'm rarely offended by posts in the D groups).
There may never be an "appropriate" place to bring this up where people's feelings are concerned, therefore I believed this was as appropriate a spot as it gets.
PC'ness has nothing to do with this. I'm not afraid of being politically incorrect where the situation calls for it as, I think, most people here have noticed by now. If this group believes every word represented in the public lexicon is fair game, then perhaps I am in the wrong place; and I will indeed move elsewhere if it comes to that -- have no fears -- rather than pretend to be the local thread police.
But, for your sake, I hope your bug is fixed in an upcoming release.
Cheers,
JJR
|
January 31, 2006 Re: Oh for christ's sake | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | Jarrett Billingsley escribió: > class A > { > this() > { > b = new B(); > b.x = 5; // illegal > } > > class B > { > protected int x; > } > > B b; > } > Unless you meant "private", I'm not sure this should be a bug. "protected" means it's visible to sub-classes, and A is not a sub-class of B, so I think it makes sense. -- Carlos Santander Bernal |
January 31, 2006 Re: Oh for christ's sake | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander | http://bibleresources.bible.com/passagesearchresults.php?passage1=Exodus+20:7&version=31 |
January 31, 2006 Re: Oh for christ's sake | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | "Jarrett Billingsley" <kb3ctd2@yahoo.com> wrote in message news:drm5ij$13eu$1@digitaldaemon.com... > class A > { > this() > { > b = new B(); > b.x = 5; // illegal > } > > class B > { > protected int x; > } > > B b; > } > > FIX THIS. First I want to ask why is B.x given protected? The reason I ask is this is also an error in C++, and there's a lot of water under the bridge for it. |
January 31, 2006 [OT] Re: Oh for Bob's sake | ||||
---|---|---|---|---|
| ||||
Posted in reply to anon | On Tue, 31 Jan 2006 00:38:16 +0000 (UTC), anon wrote: > http://bibleresources.bible.com/passagesearchresults.php?passage1=Exodus+20:7&version=31 So if 'christ' is not the name of one's God, or the expression is not a misuse of the name, then its okay to use this expression, right? Also I guess that the Exodus passage was specifically referring to YHWH and not the Jewish messiah. But seriously, we should be a bit more careful in our use of words because some expressions really do piss some people off. And on the other hand, one ought to make some allowances for cultural differences, especially in such an international and diverse forum. In general, everyone should cut everyone else some slack, okay? -- Derek (skype: derek.j.parnell) Melbourne, Australia "Down with mediocracy!" 31/01/2006 11:57:57 AM |
January 31, 2006 Re: Oh for bob's sake | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Mon, 30 Jan 2006 19:52:47 -0500, Walter Bright <newshound@digitalmars.com> wrote:
>
> "Jarrett Billingsley" <kb3ctd2@yahoo.com> wrote in message
> news:drm5ij$13eu$1@digitaldaemon.com...
>> class A
>> {
>> this()
>> {
>> b = new B();
>> b.x = 5; // illegal
>> }
>>
>> class B
>> {
>> protected int x;
>> }
>>
>> B b;
>> }
>>
>> FIX THIS.
>
> First I want to ask why is B.x given protected? The reason I ask is this is
> also an error in C++, and there's a lot of water under the bridge for it.
>
It's the same error if x is private. It's an issue because of module friendship; things in the same module should be completely accessible. I run into this issue and end up making things public just to work around it.
|
Copyright © 1999-2021 by the D Language Foundation