[comp.sys.next] Null Selector

neveu@fugitive.berkeley.edu (Charles Neveu) (07/18/90)

I have a question about SEL variables. How do you initialize a SEL variable
to have an invalid, or null, value.  That is, I have a SEL variable that I
want to initialize to a value that is invalid; some part of the program will
set the value to a valid selector; another part of the program will check 
the value to determine whether it is valid and if it is, send that message
to an object. 
So what do I initialize the variable to? 0? -1? (int) NULL?

Thanks,
Charles

shiffman@sumex-aim.stanford.edu (Smadar Shiffman) (07/18/90)

In his posting from Jul 18 neveu@fugitive.berkeley.edu writes

>I have a question about SEL variables. How do you initialize a SEL variable
>to have an invalid, or null, value.  That is, I have a SEL variable that I
>want to initialize to a value that is invalid; some part of the program will
>set the value to a valid selector; another part of the program will check
>the value to determine whether it is valid and if it is, send that message
>to an object.
>So what do I initialize the variable to? 0? -1? (int) NULL?

SEL is defined in /usr/include/objc/objc.h :
typedef unsigned int		SEL;

As far as I know 0 is not used for any selector (you can see that by
requesting 'info selector' when running gdb with some application). I would
try using 0 as an 'invalid' selector.

	Smadar
-------