• 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: Method not seeing array as array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Method not seeing array as array


  • Subject: RE: Method not seeing array as array
  • From: Jeff Laing <email@hidden>
  • Date: Fri, 4 Feb 2005 14:46:21 +1100

Hint: always review *three* times before you hit send - I wish I had...

> If you implement to the word of the spec, you'd have
>
> #ifndef nil
> #define nil ((id)0)
> #endif
>
> which strict type-checking compilers may well barf on since !
> is not a defined operation for pointer types.  Or is it?

This of course only becomes a problem when you try to apply the ! operator
to an anonymous value, which Ive tended to do through pre-processor macros.
ie,

#define SOMEFUNC(func,target)	\
	if (func() && !target) [target notify]

where I might choose to do

	SOMEFUNC(send,nil);

The evaluation of !nil by the macro processor is the issue.

(Yes, I use the pre-processor too much - its a personal failing :)
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: HFS+ File Question
  • Next by Date: RE: Method not seeing array as array
  • Previous by thread: RE: Method not seeing array as array
  • Next by thread: RE: Method not seeing array as array
  • Index(es):
    • Date
    • Thread