Re: Inheritance problem

2011-02-14 Thread spir
On 02/14/2011 05:13 PM, Steven Schveighoffer wrote: The theory for the private access in a module goes that likely the same author wrote all the code in that module, so he should understand what the code is supposed to do and have free access to anything. It seems to work pretty well in practice

Re: Inheritance problem

2011-02-14 Thread Andrej Mitrovic
On 2/14/11, Steven Schveighoffer wrote: > In C++ a friend function is able to access all private > data. The most common use of friend functions is for output stream > processors (since the operator is on the stream and not the object being > outputted). Oh right, these << << <

Re: Inheritance problem

2011-02-14 Thread Steven Schveighoffer
On Mon, 14 Feb 2011 10:52:41 -0500, Andrej Mitrovic wrote: On 2/14/11, Steven Schveighoffer wrote: What's wrong with: class Foo { private int _x, _y; this(int x, int y) { _x = x; _y = y; } int sumXY() { return _x + _y; } } Nothing! But

Re: Inheritance problem

2011-02-14 Thread Andrej Mitrovic
On 2/14/11, Steven Schveighoffer wrote: > What's wrong with: > > class Foo { > private int _x, _y; > this(int x, int y) { > _x = x; > _y = y; > } > int sumXY() { > return _x + _y; > } > } Nothing! But the OP asked why it's possible to access the

Re: Inheritance problem

2011-02-14 Thread Steven Schveighoffer
On Fri, 11 Feb 2011 17:26:29 -0500, Andrej Mitrovic wrote: On 2/11/11, bearophile wrote: Steven Schveighoffer: Any code can access any members defined in the current module, regardless of access attributes I am not sure if Walter understands how much this rule makes it hard for peopl

Re: Inheritance problem

2011-02-11 Thread spir
On 02/11/2011 11:26 PM, Andrej Mitrovic wrote: On 2/11/11, bearophile wrote: Steven Schveighoffer: Any code can access any members defined in the current module, regardless of access attributes I am not sure if Walter understands how much this rule makes it hard for people not already used

Re: Inheritance problem

2011-02-11 Thread %u
== Auszug aus Andrej Mitrovic (andrej.mitrov...@gmail.com)'s Artikel > On 2/11/11, bearophile wrote: > > Steven Schveighoffer: > > > >> Any code can access any members defined in the current module, regardless > >> > >> of access attributes > > > > I am not sure if Walter understands how much this

Re: Inheritance problem

2011-02-11 Thread Andrej Mitrovic
On 2/11/11, bearophile wrote: > Steven Schveighoffer: > >> Any code can access any members defined in the current module, regardless >> >> of access attributes > > I am not sure if Walter understands how much this rule makes it hard for > people not already used to protected/private attributes to

Re: Inheritance problem

2011-02-11 Thread %u
== Auszug aus bearophile (bearophileh...@lycos.com)'s Artikel > Steven Schveighoffer: > > Any code can access any members defined in the current module, regardless > > of access attributes > I am not sure if Walter understands how much this rule makes it hard for people not already used to protecte

Re: Inheritance problem

2011-02-11 Thread %u
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel > On Fri, 11 Feb 2011 16:14:31 -0500, %u wrote: > > == Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel > > > > Thanks, but what about the following: > > > > import std.stdio : writeln; > > > > class a { > > > >

Re: Inheritance problem

2011-02-11 Thread bearophile
Steven Schveighoffer: > Any code can access any members defined in the current module, regardless > of access attributes I am not sure if Walter understands how much this rule makes it hard for people not already used to protected/private attributes to understand and learn to use those attrib

Re: Inheritance problem

2011-02-11 Thread Steven Schveighoffer
On Fri, 11 Feb 2011 16:14:31 -0500, %u wrote: == Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel Thanks, but what about the following: import std.stdio : writeln; class a { public this(int v) { myVar = v; } protected int myVar; }

Re: Inheritance problem

2011-02-11 Thread %u
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel > On Fri, 11 Feb 2011 15:40:18 -0500, %u wrote: > > Hello, > > > > I've a problem with my class inheritance. I have class called Texture > > which implements the interface IDrawable and the abstract class > > APickable. > > The Tex

Re: Inheritance problem

2011-02-11 Thread Steven Schveighoffer
On Fri, 11 Feb 2011 15:40:18 -0500, %u wrote: Hello, I've a problem with my class inheritance. I have class called Texture which implements the interface IDrawable and the abstract class APickable. The Texture-class contains 3 members which looks like this: GLuint pTextureID; Size pSize1, pS

Inheritance problem

2011-02-11 Thread %u
Hello, I've a problem with my class inheritance. I have class called Texture which implements the interface IDrawable and the abstract class APickable. The Texture-class contains 3 members which looks like this: GLuint pTextureID; Size pSize1, pSize2; Finally... my Texture-class looks like: cl