gnustep-dev
[Top][All Lists]
Advanced

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

Re: ObjectiveC accessors


From: Marcel Weiher
Subject: Re: ObjectiveC accessors
Date: Mon, 31 May 2004 10:59:31 +0100

and apply it as:

    RACCESSORS(NSString *, rootObjectNames, RootObjectNames)
    RACCESSORS(NSArray *, prototypes, Prototypes);
    RACCESSORS(NSDictionary *, objects, Objects);

Looks good enough :-)

However, I still need to write @interface method entries for both, getter and setter,


idAccessor_h( var, setVar ) ? Or maybe: RACCESSORS_H( id , var, setVar )?

so I have to write it in: ivar list, @interface method list, and @implementaion.

you forgot:

  - dealloc method
  - archiving/unarchiving
  - copying


And this is what I would like to avoid: to write single pattern on three places.

Seven places ;-)

On the other hand, something like the way a header-file declaration works is pretty fundamental to how C works, and having stuff that automagically appears in both seems well outside the scope of C and a little extension.


Speaking about retain/release being OpenStep specific. Why not to include some kind of garbage collection into the language too?

GC and C semantics are incompatible at a fundamental level. That doesn't mean you can't have GC at an application level, but doing it safely at the language level seems impossible. Also, memory allocation isn't really at the language level, but at the library level.

It is used in majority of sources. Of course, with appropriate library hooks/callbacks, so one can implement custom GC method. I think it can be done in some simple way.

At an application-specific level, yes, just add Boehm's conservative GC. At a general library/language level: not a good idea, and not really possible while preserving existing language semantics.

Marcel

--
Marcel Weiher                           Metaobject Software Technologies
address@hidden          www.metaobject.com
Metaprogramming for the Graphic Arts.   HOM, IDEAs, MetaAd etc.
                1d480c25f397c4786386135f8e8938e4





reply via email to

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