Rubyã®Procã®èª¬æã¯å··ã«æº¢ãã¦ããããä»æ´æããããã©ããæ°åProcã使ã£ããã¿ãæ¸ãã¦ãããProcããããããªã£ã¡ãã£ã¦ãã£ã¨ã¿ããªã«ãProcã®ãã¨ç¥ã£ã¦ãããããã¨ãã欲æ±ãçã¾ãã¦ããããProcã«ã¤ãã¦ã®åºæ¬çãªãã¨ãåãªãã®ããæ¹ã§ããã«æ¸ãããé·ããã Rubyã®é¢æ°ï¼ã¡ã½ããï¼ Rubyã«ããã¦é¢æ°ï¼ã¡ã½ããï¼ã¯ãã¡ã¼ã¹ãã¯ã©ã¹ï¼ãªãã¸ã§ã¯ãï¼ã§ã¯ããã¾ãããã¤ã¾ãæååãæ°åãé åãªã©ã®ä»ã®ãªãã¸ã§ã¯ãã¨ã¯ç°ãªã£ã¦ãRubyã§ã¯ãããç´æ¥å¤æ°ã«ä»£å ¥ããããä»ã®é¢æ°ã«æ¸¡ããããããã¨ã¯ã§ãã¾ããã def square(n) n * n end sq = square # squareã¡ã½ãããå¤æ°sqã«ä»£å ¥ãã¦ã¿ã # ~> -:1:in `square': wrong number of arguments (0 for 1) (ArgumentError)
{{#tags}}- {{label}}
{{/tags}}