• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Code Guidelines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Re: Code Guidelines (From: Alex Curylo <email@hidden>)

  • Prev by Date: Re: Problem with drawer
  • Next by Date: Re: willPositionSheet never called ??
  • Previous by thread: Re: Code Guidelines
  • Next by thread: Re: Buttons work under 10.3.4 but not 10.2.8
  • Index(es):
    • Date
    • Thread