Hello,
It's somewhat common task to convert a constant string to a selector. On Thu, Apr 19, 2018 at 8:43 PM, Dmitry Boyarintsev <
Show quoted text 7 lines
The documentation: http://wiki.freepascal.org/FPC_PasCocoa suggests to use compiler built-in function ObjCSelector. I presume this turns the selector into a constant, thus has no impact on the runtime.
However, how hard would it be to make the compiler itself to implicitly convert a string constant to a objc selector?
As well as a constant string to a constant objective-C string (without using NSSTR())?
ObjC itself introduced @'...' syntax. (Due to C-syntax ambiguity?) Does similar ambiguity exist for Pascal syntax?
It doesn't seem to have any problems to implicitly convert constant strings to pchars, array of chars, ansistring, widestrings, OLEStrings - which is similar to NSStrings a platform specific string.
thanks,
Dmitry
