Re: Code Guidelines
Re: Code Guidelines
- Subject: Re: Code Guidelines
- From: Ondra Cada <email@hidden>
- Date: Tue, 1 Jun 2004 21:52:47 +0200
Alex,
On 1.6.2004, at 20:16, Alex Curylo wrote:
>
> there is
>
> no reason altogether to tell parameters from locals: they are the very
>
> very same thing
>
... Changing the values pointed to by
>
reference and pointer parameters affects code outside the local scope,
>
which
>
manipulating a local doesn't. ...
Wrong.
First, there's no thing as a "by reference" parameter at all: all
parameters in ObjC (or Java) are value ones. Sure, there are languages
which support them (my favourite used to be Algol with its by-name
parameters ;)), but (Obj)C is not one of them.
Then, of course you could (and often would) use (in ObjC) a pointer
argument to implement a de-facto by-reference argument. In that case
though, a local variable can contain the very same value with the very
same consequences:
void foo(int *arg) { ... int *localArg=arg; ... }
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.