discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libobjc] May I tweak objc-api.h?


From: Kaelin Colclasure
Subject: Re: [libobjc] May I tweak objc-api.h?
Date: Sat, 7 Feb 2004 08:19:12 -0800

On Feb 6, 2004, at 8:31 PM, Nicola Pero wrote:


But the structs are used in GNUStep and which cannot change just
support one version of
gcc.  They have to support multiple versions of gcc.  I rescind my ok
on this.  Knowing that
programs will brake.  Also changing it conditional on __cplusplus is
okay with me as it is
okay with Alex.

Hey, we're all supposed to be OO thinkers: How about we introduce an
accessor macro for this field, called say OBJC_SUPER_CLASS.

That wouldn't help much since previous release of libobjc don't define it. You'd still have to make a difference between new libojcs (where you can
use the macro) and old ones (where you can't use the macro).

#ifndef OBJC_SUPER_CLASS
#define OBJC_SUPER_CLASS(s) ((s)->class)
#endif

And, like magic, your code can consistently use the macro everywhere. :-)

At that point, it's entirely equivalent but simpler to use .class for old
libobjcs and .super_class for new ones.

This reduces to an argument against accessors in general.

-- Kaelin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]