{"published":"2012-05-27 20:50:30","provider_name":"Hatena Blog","description":"\u306a\u3093\u304b\u306e\u51e6\u7406\u3092\u307e\u3068\u3081\u308b\u3068\u304d\u3001\u901a\u5e38\u306fdef \u3092\u4f7f\u3044\u307e\u3059\u306d\u3002 \u3067\u3059\u304cdef \u306fdef\u306e\u5916\u5074\u306b\u3042\u308b\u5909\u6570\u3092\u8aad\u307f\u8fbc\u3081\u307e\u305b\u3093\u3002\uff08\u30b9\u30b3\u30fc\u30d7\uff09 \u306a\u306e\u3067lambda \u3092\u4f7f\u3063\u3066\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u4e0a\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3067\u8aad\u307f\u8fbc\u3081\u308b\u3088\u3046\u306b\u3059\u308b\u306e\u3067\u3059\u3002 1 b = 1 2 def add a 3 puts a + b 4 end 5 6 add 3 >`add': undefined local variable or method `b' for main:Object (NameError) \u3082\u3061\u308d\u3093b\u306fdef\u306e\u5916\u5074\u306a\u306e\u3067\u30a8\u30e9\u30fc\u3002\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3092\u4f7f\u3046\u3057\u304b\u306a\u3044\u306e\u304b\u30fb\u30fb\uff01\uff1f \u3044\u3084\u3002 8 b = 1 9 bl = lambda {|\u2026","provider_url":"https://hatena.blog","blog_title":"\u30dc\u30af\u30b3\u30b3","title":"\u547c\u3073\u51fa\u3057\u53ef\u80fd\u30aa\u30d6\u30b8\u30a7\u30af\u30c8","categories":["Ruby"],"version":"1.0","height":"190","image_url":null,"width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbokukoko.hatenablog.com%2Fentry%2F20120527%2F1338119430\" title=\"\u547c\u3073\u51fa\u3057\u53ef\u80fd\u30aa\u30d6\u30b8\u30a7\u30af\u30c8 - \u30dc\u30af\u30b3\u30b3\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://bokukoko.hatenablog.com/entry/20120527/1338119430","type":"rich","author_name":"cevid_cpp","blog_url":"https://bokukoko.hatenablog.com/","author_url":"https://blog.hatena.ne.jp/cevid_cpp/"}