Contents (package MULK.OBJECTIVE-CL)
Retrieve a method selector by name, or create it if it does not exist.
Returns: selector --- a selector object.
If selector-name is a string, the selector named by that string is returned. If no selector with the given name exists, such a selector is created and registered with the Objective-C runtime, after which it is returned.
1. The first part is fully converted to <em>[lowercase](http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_l.htm#lowercase)</em>. 2. Any additional parts are also fully converted to <em>[lowercase](http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_l.htm#lowercase)</em> except for their first letters, which are left intact.
If the symbol is a keyword, the resulting string is suffixed by a colon (`:').
After that, all parts are concatenated in order to form a single selector name component. The selector name components are in turn concatenated in order to form the string that identifies the selector, which is used as if given directly as an argument to a call to intern-selector.
Note that the conversion rules for selector names are identical to those by which invoke converts its arguments into a message name.
(intern-selector "self") ;=> #<SELECTOR `self'> (intern-selector '(self)) ;=> #<SELECTOR `self'> (intern-selector 'self) ;=> #<SELECTOR `self'> (intern-selector "stringWithCString:encoding:") ;=> #<SELECTOR `stringWithCString:encoding:'> (intern-selector '(:string-with-c-string :encoding)) ;=> #<SELECTOR `stringWithCString:encoding:'> #.(setq *readtable* (copy-readtable)) #.(setf (readtable-case *readtable*) :invert) (intern-selector '(:stringWithCString :encoding)) ;=> #<SELECTOR `stringWithCString:encoding:'>
On the other hand, writing all method names in lower case while separating parts by hyphens works nicely in all of the
:PRESERVE modes as well as Allegro CL's modern mode.