{"id":9391,"date":"2014-08-24T15:45:32","date_gmt":"2014-08-24T19:45:32","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=9391"},"modified":"2014-08-24T15:45:32","modified_gmt":"2014-08-24T19:45:32","slug":"implicitly-converting-functions-to-return-optionals","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2014\/08\/24\/implicitly-converting-functions-to-return-optionals\/","title":{"rendered":"Implicitly Converting Functions to Return Optionals"},"content":{"rendered":"<p><a href=\"http:\/\/airspeedvelocity.net\/2014\/08\/17\/implicitly-converting-functions-to-return-optionals\/\">Airspeed Velocity<\/a>:<\/p>\n<blockquote cite=\"http:\/\/airspeedvelocity.net\/2014\/08\/17\/implicitly-converting-functions-to-return-optionals\/\"><p>As we <a href=\"http:\/\/airspeedvelocity.net\/2014\/08\/12\/yo-dawg\/\">saw<\/a> <a href=\"http:\/\/airspeedvelocity.net\/2014\/08\/13\/bachman-ternary-overdrive\/\">previously<\/a>, if you pass a non-optional value to a function argument that expects an optional, it will get automatically converted into an optional by the compiler.<\/p>\n<p>Ken Ferry <a href=\"https:\/\/twitter.com\/kongtomorrow\/status\/497840599953702912\">points out<\/a> something that goes one step further.  If a function takes an argument of a function that returns an optional, and you pass into it a function that does not return an optional, the function will automatically be converted to return an optional.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Airspeed Velocity: As we saw previously, if you pass a non-optional value to a function argument that expects an optional, it will get automatically converted into an optional by the compiler. Ken Ferry points out something that goes one step further. If a function takes an argument of a function that returns an optional, and [&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":[46,71,901],"class_list":["post-9391","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-languagedesign","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/9391","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=9391"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/9391\/revisions"}],"predecessor-version":[{"id":9392,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/9391\/revisions\/9392"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=9391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=9391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=9391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}