{"id":467,"date":"2019-12-12T17:28:00","date_gmt":"2019-12-13T00:28:00","guid":{"rendered":"https:\/\/www.great-white-software.com\/blog\/?p=467"},"modified":"2019-12-03T17:36:11","modified_gmt":"2019-12-04T00:36:11","slug":"method-signatures","status":"publish","type":"post","link":"https:\/\/www.great-white-software.com\/blog\/2019\/12\/12\/method-signatures\/","title":{"rendered":"Method signatures"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I know I&#8217;ve probably used this term a bunch in other blog posts but I don&#8217;t think I&#8217;ve ever explained what a method signature is.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In Xojo a &#8220;method signature&#8221; is the unique way Xojo identifies each method so it can know which method you are calling in your code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So what does that include ?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First off it does NOT include  the SCOPE. PRIVATE, PUBLIC, GLOBAL, and PROTECTED  are scope modifiers &#8211; but they are not part of the signature of a method.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Attributes are also not part of the signature.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And, curiously enough, the return type is NOT part of the signature. While that determines where you can use the method (ie in an expression where a value is expected vs not) it is NOT part of the signature.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The signature includes only the name and parameter list.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It gets a LOT more confusing if your parameter lists have optional or default parameter values since the signature basically can be thought to be &#8220;variable&#8221; &#8211; but its still just the name and parameter list.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And if you ever get an error saying <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em> There is more than one item with this name and it&#8217;s not clear to which this refers.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">and the compiler has hilighted a method call then the likelihood is you have two signatures that can be treated the same and the compiler cannot figure out which one you really meant to use.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I know I&#8217;ve probably used this term a bunch in other blog posts but I don&#8217;t think I&#8217;ve ever explained what a method signature is. In Xojo a &#8220;method signature&#8221; is the unique way Xojo identifies each method so it can know which method you are calling in your code. So what does that include &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.great-white-software.com\/blog\/2019\/12\/12\/method-signatures\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Method signatures&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-467","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/comments?post=467"}],"version-history":[{"count":1,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/467\/revisions"}],"predecessor-version":[{"id":468,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/467\/revisions\/468"}],"wp:attachment":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/media?parent=467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/categories?post=467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/tags?post=467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}