Re: private redeclaration of an instance variable

2013-07-01 Thread Matt Neuburg
On Jun 29, 2013, at 7:48 PM, David Duncan wrote: > On Jun 29, 2013, at 11:18 AM, Matt Neuburg wrote: > >> >> On Jun 29, 2013, at 10:55 AM, Jens Alfke wrote: >> >>> This is just a parsing issue. If an ivar is declared in a class’s public >>> interface, it’s in scope in any method of that cl

Re: private redeclaration of an instance variable

2013-06-29 Thread David Duncan
On Jun 29, 2013, at 11:18 AM, Matt Neuburg wrote: > > On Jun 29, 2013, at 10:55 AM, Jens Alfke wrote: > >> This is just a parsing issue. If an ivar is declared in a class’s public >> interface, it’s in scope in any method of that class or a subclass. So if a >> subclass declares an ivar with

Re: private redeclaration of an instance variable

2013-06-29 Thread Daniel DeCovnick
Trying this again, reply all this time... Jens, I think you’ve got the question backwards: the public ivar is in the base class, and the private one is in the subclass, and it works, even though they should both be in scope in the subclass’s implementation. I suppose it could be basically C-sty

Re: private redeclaration of an instance variable

2013-06-29 Thread Matt Neuburg
On Jun 29, 2013, at 10:55 AM, Jens Alfke wrote: > This is just a parsing issue. If an ivar is declared in a class’s public > interface, it’s in scope in any method of that class or a subclass. So if a > subclass declares an ivar with the same name, you now have a conflict and the > parser won

Re: private redeclaration of an instance variable

2013-06-29 Thread Jens Alfke
On Jun 29, 2013, at 10:23 AM, Matt Neuburg wrote: > Am I reading this right? It's permitted to override an inherited instance > variable, but only if you do so privately? m. First, you can’t override an instance variable; they aren’t dynamic enough. An ivar is like a struct field, it compiles

private redeclaration of an instance variable

2013-06-29 Thread Matt Neuburg
As you know, these days, we are allowed to declare an instance variable in curly braces in the @implementation section rather than the @interface section. Well, then: * Suppose two classes, MyClass and its subclass MyClass2. * Suppose MyClass publicly declares an instance variable "thing". I o