{"id":145,"date":"2006-05-16T22:04:41","date_gmt":"2006-05-16T21:04:41","guid":{"rendered":"http:\/\/www.nobugs.org\/blog\/archives\/2006\/05\/16\/methodfinder-for-ruby\/"},"modified":"2006-05-16T22:04:41","modified_gmt":"2006-05-16T21:04:41","slug":"methodfinder-for-ruby","status":"publish","type":"post","link":"https:\/\/www.nobugs.org\/blog\/archives\/2006\/05\/16\/methodfinder-for-ruby\/","title":{"rendered":"MethodFinder for Ruby"},"content":{"rendered":"<p>I was preparing a talk about Smalltalk for the boys and girls at <a title=\"Amazon\" href=\"http:\/\/www.amazondc.com\">Amazon<\/a> when it occured to me that it&#8217;s easy to implement Smalltalk&#8217;s MethodFinder in Ruby.  So, without further ado, here&#8217;s a <a href=\"http:\/\/www.nobugs.org\/developer\/ruby\/method_finder.html\">Ruby MethodFinder<\/a>.  Take the red pill, dynamic Neo!<\/p>\n<p>Excerpt from the article:<\/p>\n<p><em>I use lots of different programming languages, and they all seem to have different names for the same       concepts.  For example, string concatenation is &#8220;+&#8221; in ruby and java, &#8220;.&#8221; in perl, &#8220;,&#8221; in smalltalk and &#8220;^&#8221; in ocaml.       After a while, this starts to drive you mad.  I know that I want a method which takes &#8220;foo&#8221; and &#8220;bar&#8221; and returns &#8220;foobar&#8221;       but I can&#8217;t remember which incantation I need to utter today.<\/em><\/p>\n<p><em>Smalltalk has this neat thing called the MethodFinder.  It lets      you find methods by providing an example.  If you&#8217;ve got the      string &#8220;foo&#8221;, you can ask the MethodFinder to find all the method      that, when called with argument &#8220;bar&#8221; return &#8220;foobar&#8221;.  This is a      very useful tool.  No more scrabbling around with documentation      to find the name of a method which you know exists.  Stay in the      red-pill world, and ask the code.<\/em><\/p>\n<p><em>      Now, ruby is basically smalltalk (without lots of the k3wl bits).  So we can easily build a method finder in ruby too! <\/em><\/p>\n<p>Read the <a href=\"http:\/\/www.nobugs.org\/developer\/ruby\/method_finder.html\">full article here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was preparing a talk about Smalltalk for the boys and girls at Amazon when it occured to me that it&#8217;s easy to implement Smalltalk&#8217;s MethodFinder in Ruby. So, without further ado, here&#8217;s a Ruby MethodFinder. Take the red pill, dynamic Neo! Excerpt from the article: I use lots of different programming languages, and they [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-145","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/posts\/145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/comments?post=145"}],"version-history":[{"count":0,"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/posts\/145\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/media?parent=145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/categories?post=145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/tags?post=145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}