Contents (package MULK.OBJECTIVE-CL)

Constant Variable +YES+


The Objective-C boolean value YES.

Value Type:

a number.


+yes+ is the constant corresponding to the Objective-C YES value.

As there is no way to distinguish methods that return booleans from those that return numbers in the Objective-C runtime, all invocations that ought to return booleans will actually return one of two compile-time Objective-C constants: either YES or NO. Lisp code using Objective-CL needs to be aware of this and test return values accordingly. For this to be possible, two constants are defined on the Lisp side, analogously to Objective-C. These are called +yes+ and +no+.


(invoke (find-class 'ns-string)  
        :is-subclass-of-class (find-class 'ns-object))  
 ;=> #.YES  
(invoke (find-class 'ns-object)  
        :is-subclass-of-class (find-class 'ns-object))  
 ;=> #.YES  
(invoke (find-class 'ns-object)  
        :is-subclass-of-class (find-class 'ns-string))  
 ;=> #.NO  

See Also: