rubyã¯ä¾¿å©ï¼ã§ãæ®æ®µC/C++ã使ã£ã¦ããèªåã«ã¨ã£ã¦ï¼ãã¾ã«ãã使ããªãrubyã¯å¤å½èªãã®ãã®ï¼ ãã¤ã google ã§æ§æãè¨æ³ãæ¤ç´¢ãã¦ããï¼
ããã§ruby ã®æ§æã¨ãæ¸ãæ¹ãã¡ã¢ãã¦ããã°ï¼æçµçã«Cè¨èªä½¿ãã®ããã® rubyæ´»ç¨å¤§è¾å ¸ã®ãããªããã¥ã¡ã³ããåºæ¥ãã®ã§ã¯ï¼ã¨æã£ãã®ã ãã©â¦çµå± google ã§ãã®ã¤ã©æ¤ç´¢ããç¾½ç®ã«ï¼
ã¨ã«ããï¼ä»æ¥ããã¹ãäºï¼
printf("%d %f\n", a, b) print "%d %f\n", n, val
fprintf(stderr, "%s %e") STDERR.print, s, val
ãããªããã³ãªãã¨ãããå¿ãã¦ãã¾ããªãã¦ã¢ãã ã俺ï¼
ã¨ã«ãã次åããã¯æ¥è¨ã®æ¤ç´¢æ©è½ã§æ¤ç´¢ããã°ä»æ¥ã®æ¥è¨ãè¦ã¤ãã£ã¦å¹¸ãã«ãªããã¨è¦ãï¼
ã¨ããã§ï¼Cè¨èªã ã¨
foo(obj,arg)
ã¨æ¸ãé¨åã¯ï¼ãªãã¸ã§ã¯ãæåãªrubyã ã¨
obj.foo(arg)
ã¨ãªãï¼çå±ã®ä¸ã§ã¯è§£ã£ã¦ããã®ã ãã©ï¼printf(stderr) ã stderr.printf() ã¨è¨è¿°ããã®ã¯ï¼æ£ç´æ¸æã£ã¦ãã¾ãï¼äººéãæ³ãåãã¨é åºã«ãªã£ã¦èéãå©ããªããªãã®ã¨åãããã«ï¼æ¯æ¥Cè¨èªã°ã£ãã使ã£ã¦ããã¨èéãå©ããªãããã»ã¨ã³ã¸ãã¢ã«ãªãã®ããï¼