4 ms·
Alternate (even better) solution: Use a language where you can optionally name parameters, like C#. xhr.OpenUrl(url, async: true);
by 1wd 12y ago
Alternate (even better) solution: Use a language where you can optionally name parameters, like C#.
xhr.OpenUrl(url, async: true);
- gmac 12y agoActually, even in Objective-C it's technically optional to give your parameters names. Feel free to knock yourself out with method signatures like: - (void)doMysteriousThingsWithParameters:(int)x :(BOOL)y :(NSString*)z; I've come across this recently when creating an HTML5 <canvas> context object to be called from within JavaScriptCore. This needs to expose JS-friendly methods like: - (void)strokeRect:(CGFloat)x :(CGFloat)y :(CGFloat)w :(CGFloat)h; - (void)arc:(CGFloat)x :(CGFloat)y :(CGFloat)radius :(CGFloat)startAngle :(CGFloat)endAngle :(BOOL)antiClock;
- 1wd 12y agoInteresting. I don't use Object-C, but always heard parameter names are actually considered to be part of the method name there. Was that wrong? Ah, or do you mean the name is just empty? How does that work on the implementation side? I.e. how do you refer to the passed arguments?
- fyolnish 12y agoParameters don't have names, the message has a format, and th only rule of that format(referred to as a "selector") is that parameters are preceded by a :
- anton_gogolev 12y agoMore, more parentheses!