Re: VC# vs. ObjC and partial abstract classes

2014-03-19 Thread Maxthon Chan
You can emulate this behaviour somehow by not implementing the methods that is abstract, and prevent instantiation by introspecting and throwing exceptions in -init;. Definitely non-trivial but works. On Mar 19, 2014, at 23:43, William Squires wrote: > > On Mar 18, 2014, at 9:29 PM, Luther Ba

Re: VC# vs. ObjC and partial abstract classes

2014-03-19 Thread William Squires
On Mar 18, 2014, at 9:29 PM, Luther Baker wrote: > On Tue, Mar 18, 2014 at 8:11 PM, Kyle Sluder wrote: > On Tue, Mar 18, 2014, at 05:30 PM, William Squires wrote: > > Hi all! > > Obviously (IIRC) a pure abstract class would map to a formal protocol > > in ObjC (or a class interface in langu

Re: VC# vs. ObjC and partial abstract classes

2014-03-19 Thread Jens Alfke
On Mar 19, 2014, at 7:32 AM, Sixten Otto wrote: > (I'm hard pressed to think of much use for such a "pure" abstract class, > though; what could you do with such a thing that couldn't be done with > interfaces.) "Pure abstract class" is a C++ term. It's the C++ equivalent of an interface. It's

Re: VC# vs. ObjC and partial abstract classes

2014-03-19 Thread Sixten Otto
On Tue, Mar 18, 2014 at 5:30 PM, William Squires wrote: > My best guess is to: > > 1) Make an ObjC class, and have it implement those methods that subclasses > don't have to override. For those the subclasses must override, implement a > stub that raises an exception if a message is sent to it (as

Re: VC# vs. ObjC and partial abstract classes

2014-03-19 Thread Sixten Otto
On Wed, Mar 19, 2014 at 12:38 AM, Luther Baker wrote: > On Wed, Mar 19, 2014 at 12:14 AM, Sixten Otto wrote: > >> The significant difference, though, between an abstract class in Java or >> > C#, and a protocol in Objective-C, is that the former may have substantial >> implementation associated w

Re: VC# vs. ObjC and partial abstract classes

2014-03-19 Thread Luther Baker
> And more to the point, I think the original poster already knows what you > are saying. I think he is asking for thoughts regarding his approach to > simulating a notional Abstract Class via mix of @protocols and @classes in > Objective-C. He clearly knows he can't do it with @protocols alone. >

Re: VC# vs. ObjC and partial abstract classes

2014-03-19 Thread Luther Baker
On Wed, Mar 19, 2014 at 12:14 AM, Sixten Otto wrote: > On Tue, Mar 18, 2014 at 7:29 PM, Luther Baker > wrote: > > > A _better_ analogy to an Objective-C @protocol would be a formal Java > > interface. > > > > Sure. And the same in C# (which the OP was asking about). > > Can't tell if you are agr

Re: VC# vs. ObjC and partial abstract classes

2014-03-18 Thread Sixten Otto
On Tue, Mar 18, 2014 at 7:29 PM, Luther Baker wrote: > A _better_ analogy to an Objective-C @protocol would be a formal Java > interface. > Sure. And the same in C# (which the OP was asking about). > So, Kyle may have good reasons for his answer - but if I understand the > essence of your ques

Re: VC# vs. ObjC and partial abstract classes

2014-03-18 Thread Chris Hanson
On Mar 18, 2014, at 7:29 PM, Luther Baker wrote: > A _better_ analogy to an Objective-C @protocol would be a formal Java > interface. In their design, Java’s interfaces were explicitly modeled on Objective-C’s @protocol construct. -- Chris ___ C

Re: VC# vs. ObjC and partial abstract classes

2014-03-18 Thread Luther Baker
On Tue, Mar 18, 2014 at 8:11 PM, Kyle Sluder wrote: > On Tue, Mar 18, 2014, at 05:30 PM, William Squires wrote: > > Hi all! > > Obviously (IIRC) a pure abstract class would map to a formal protocol > > in ObjC (or a class interface in languages such as REALbasic/Xojo, or > > VB 6). My best

Re: VC# vs. ObjC and partial abstract classes

2014-03-18 Thread Kyle Sluder
On Tue, Mar 18, 2014, at 05:30 PM, William Squires wrote: > Hi all! > Some languages (like C++ and Visual C#) allow for partial abstract > classes (i.e. some methods are implemented, while others are left to > subclasses to implement - and, in fact, must implement since the > partial abstra