discuss-gnustep
[Top][All Lists]
Advanced

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

Re: GNUstep.h (was: Re: Setter Gettor method style)


From: Jeremy Bettis
Subject: Re: GNUstep.h (was: Re: Setter Gettor method style)
Date: Wed, 7 Aug 2002 06:22:29 -0500

And why not just
#define TEST_AUTORELEASE(object) [object autorelease]

Since methods sent to nil are really not a bad thing.

Oh sure in the case where the object is nil you have a function call where
you could have gotten away with just a branch instruction, but the
objc_send_msg is going to check for nil again anyway.

----- Original Message -----
From: "Nicola Pero" <nicola@brainstorm.co.uk>
To: "Sir Raorn" <raorn@binec.ru>
Cc: <discuss-gnustep@gnu.org>
Sent: Wednesday, August 07, 2002 3:20 AM
Subject: Re: GNUstep.h (was: Re: Setter Gettor method style)


>
> > On Tue, Aug 06, 2002 at 10:20:49PM +0200, Lars Sonchocky-Helldorf wrote:
> > > #define TEST_AUTORELEASE(object) ({ if (object) [object
autorelease]; })
> > I'd suggest this variant:
> >
> > #define TEST_AUTORELEASE(object) do{ if (object) [object
autorelease]; }while(0)
> >
> > And the same for other multioperator defines...
>
> Some people like to do -
>
>  something = AUTORELEASE ([NSSomething new]);
>
> which only works with ({}), not with do{}while(0).
>
>
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://mail.gnu.org/mailman/listinfo/discuss-gnustep
>




reply via email to

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