This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Objective-C : Do not accept an object as parameter to a method
- From: Devang Patel <dpatel at apple dot com>
- To: Nicola Pero <nicola at brainstorm dot co dot uk>
- Cc: Zack Weinberg <zack at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 28 Jun 2002 12:09:38 -0700
- Subject: Re: [PATCH] Objective-C : Do not accept an object as parameter to a method
On Thursday, June 27, 2002, at 03:02 AM, Nicola Pero wrote:
An object is declared as in (NSObject *) [it's really a pointer to the
actual object] - and unless you do low-level things such as casting it
to
a pointer to an appropriate struct etc which you can always do - you
must
always pass around pointers/references to objects, rather than the
objects
themselves.
His patch looks like preventing something like 'NSObject' to be used as
the type for a method argument ... which would be the hypothetical
syntax
to pass the object itself (rather than a pointer to the object) as
argument to a method ... this syntax won't currently work as far as I
know
(but the compiler doesn't reject it) - and I agree with Devang it's
not a
good idea to make it work :-) it's better to raise an error as that
might
catch a common typing mistake (leaving out the '*').
Exactly.
Devang