{"id":4465,"date":"2012-03-12T10:31:59","date_gmt":"2012-03-12T15:31:59","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=4465"},"modified":"2012-03-12T10:32:02","modified_gmt":"2012-03-12T15:32:02","slug":"objective-c-operators","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2012\/03\/12\/objective-c-operators\/","title":{"rendered":"Objective-C Operators"},"content":{"rendered":"<p><a href=\"http:\/\/blog.darkrainfall.org\/a-potential-direction-for-objective-c\/\">Gwynne Raskind<\/a>:<\/p>\n<blockquote cite=\"http:\/\/blog.darkrainfall.org\/a-potential-direction-for-objective-c\/\"><p>\nI do strongly support the concept of <code>@==<\/code> and <code>@!=<\/code> operators that equate to <code>[object isEqual:]<\/code> and its negation, as well as the associated <code>@&lt;<\/code>, <code>@&gt;<\/code> etc. operators. If one of the objects in question can be determined not to implement compare:, throw a compile error. If either operand is typed <code>id<\/code>, throw a runtime exception, exactly as <code>[(id)[[NSObject alloc] init] compare:]<\/code> would do now. In short, make the operators mere syntactic sugar, just like dot-syntax and the collection literals, rather than trying to toy with the runtime as <code>@\"\"<\/code> does.\n<\/p><\/blockquote>\n<p>The new collection literals and indexing syntax are no longer under NDA. The full details (e.g. the meaning of negative indexes) are still forthcoming, but it looks as though Apple got this right. Raskind&rsquo;s proposal seems like a good next step.<\/p>","protected":false},"excerpt":{"rendered":"<p>Gwynne Raskind: I do strongly support the concept of @== and @!= operators that equate to [object isEqual:] and its negation, as well as the associated @&lt;, @&gt; etc. operators. If one of the objects in question can be determined not to implement compare:, throw a compile error. If either operand is typed id, throw [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-4465","post","type-post","status-publish","format-standard","hentry","category-programming-category"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/4465","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=4465"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/4465\/revisions"}],"predecessor-version":[{"id":4466,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/4465\/revisions\/4466"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=4465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=4465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=4465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}