ãããã¿ã¤ããã¼ã¹ã®èª¤è§£
ã¯ã©ã¹ãã¼ã¹ã®OOã¨ãããã¿ã¤ããã¼ã¹ã®OOã§æ±ºå®çã«éãã®ã¯ãããã°ã©ã ãåããã¦ããæä¸ã«ãªãã¸ã§ã¯ããåºæ¥ããã¨ãããªãã¡ã¡ã½ãã(method)ã追å ãããåå®ç¾©ãããã§ãããã ã
404 Blog Not Found:タイプ・クラス・プロトタイプ - OOの語彙
ããã¯ã²ã©ããï½ããªãã¸ã§ã¯ãã«å¯¾ãã¦åçï¼å®è¡æï¼ã«ã¡ã½ãããã¤ã³ã¹ã¿ã³ã¹å¤æ°ã追å ã§ãããã¨ã¨ãâãããã¿ã¤ããã¼ã¹âã«ããã¦ãªãã¸ã§ã¯ãããããå±ããã¯ã©ã¹ã«ãããç¬èªã®ã¡ã½ãããã¤ã³ã¹ã¿ã³ã¹å¤æ°ãæã¦ããã¨ã¨ã¯å¥ã®è©±ã§ãã
ããããã¦ãããããã¿ã¤ããã¼ã¹ãã¨ããç¨èªèªä½ã«åé¡ãå¤ããã¨ãå®æãããããè¨äºã§ãããã¾ãããå人çã«ã¯ãã¯ã©ã¹ãç¨ããªããªãã¸ã§ã¯ãçæææ³ã®è©±ã§ãªãã®ãªãã°ï¼ã¤ã¾ããããããã¿ã¤ãã®è¤è£½ã§ãªãã¸ã§ã¯ããçæããããã¨ã話ã®æ¬çã§ãªããªãã°ï¼ããããã¿ã¤ããã¼ã¹ãã§ã¯ãªãããã¤ã³ã¹ã¿ã³ã¹ãã¼ã¹ãï¼ãããã¯ããªãã¸ã§ã¯ããã¼ã¹ãâ¦ï¼ã¨è¨ãæãããã¨ãæ¨å¥¨ãã¦ãã¾ããæè¿ã¯èª¬æãé¢åã§ããããã¿ã¤ããã¼ã¹ãã§éãã¦ãã¾ããã¨ãå¤ãã®ã§ããâ¦åçã
ï¼ã¡ãªã¿ã«ãã¤ã³ã¹ã¿ã³ã¹ãã¼ã¹ããããªãã¸ã§ã¯ããã¼ã¹ãã¨ããã®ã¯ãå¥ã«ç§ã®é èªã¨ããããã§ã¯ãªããè«æãæ¸ç±ãªã©ã§æ¯è¼çå¤ããã使ããã¦ããç¨èªã§ãã
ç¹°ãè¿ãã«ãªãã¾ãã念ã®ããããªãã¸ã§ã¯ãããããå±ããã¯ã©ã¹ã«ãããç¬èªã®ã¡ã½ãããã¤ã³ã¹ã¿ã³ã¹å¤æ°ãæã¦ããã¨*ãã*ããããããã¿ã¤ããã¼ã¹ããããããã¤ã³ã¹ã¿ã³ã¹ãã¼ã¹ãã®æ¬è³ªã§ãã
ããããã¿ã¤ããã¼ã¹ãã¨ããã¨ï¼ãããä¸ã«åºãã SELF ã®å½±é¿ã§ï¼ãã¯ã©ã¹ããªããã¨ç絡ãã人ãå¤ãã®ãåé¡ã®ã²ã¨ã¤ã§ããããããåã£ãæããã¿ãææããã®ã«ããã¤ã³ã¹ã¿ã³ã¹ãã¼ã¹ãã¨ã®è¨ãæãã¯æå¹ã ã¨æãã¾ãããªãã¸ã§ã¯ããç¬èªã®ã¹ããããæã¦ããã¨ã¨ããã®ãªãã¸ã§ã¯ããã¯ã©ã¹ã«å±ãããã¨ã¯çç¾ããªããã¤ã¾ãã¤ã³ã¹ã¿ã³ã¹ãã¼ã¹ã®è¨èªã§ãã¯ã©ã¹ãæã¤ãã¨ã¯ã§ããããéã«ãã¯ã©ã¹ãã¼ã¹è¨èªã§ãï¼ãã®è¨èªãã¯ã©ã¹ãã¼ã¹ã«ããã¦ç´ç²ããç®æããªãéãã«ããã¦â¦ï¼ãã®ãªãã¸ã§ã¯ãã«ã¤ã³ã¹ã¿ã³ã¹ãã¼ã¹çç´ é¤ãæããããã¨ã¯å¯è½ã§ãã
å®éãå®å ¨ãªã¤ã³ã¹ã¿ã³ã¹ãã¼ã¹ã®è¨èªï¼NewtonScriptãJavaScriptãActionScriptï¼ã«ã¯ã©ã¹ããã£ã¦ãã¾ã£ããåé¡ã¯ãªãããã§ãããã¯ã©ã¹ãã¼ã¹ã®è¨èªï¼RubyãPythonï¼ã§ãã£ã¦ãããªãã¸ã§ã¯ããã¤ã³ã¹ã¿ã³ã¹ãã¼ã¹çç´ é¤ãæã¤ä¾ã¯ãããããããã¾ããã
ã¡ãªã¿ã«ãRuby ã®ã¤ã³ã¹ã¿ã³ã¹ãã¼ã¹çå´é¢ã¨ãã¦åãããããããã¨ãå¤ããç¹ç°ã¡ã½ãããï¼ã¤ã³ã¹ã¿ã³ã¹ç¹ç°çã¡ã½ããï¼ã§ãããå®ã¯ãã®æ©è½ãç¡åã§é常ã¯ä¸å¯è¦ã®ãç¹ç°ã¯ã©ã¹ãï¼ã¤ã³ã¹ã¿ã³ã¹ç¹ç°çã¯ã©ã¹ï¼ãä»ãã¦å®ç¾ããã¦ãã¾ããããããã¡ã½ããã®æ±ãã«éã£ã¦ã¯ãSmalltalk åæ§ããããã¦ãå ãã¯ã©ã¹ãã¼ã¹ã®è¨èªã§ãã Ruby ã§ã¯ããç¹ç°ã¡ã½ããããï¼ã¤ã³ã¹ã¿ã³ã¹ãã¼ã¹ã®è¨èªã§ãªãé常ããããããã«â¦ï¼ãªãã¸ã§ã¯ãã¸ã®ã¹ãããã®è¿½å ã¨ããããã¡ã§è¡¨ç¾ã§ããªããããããããè¦èã®çãã¨ããã¦ããããã§ããé¢ç½ãã§ããã
ãªããããããã¿ã¤ããã¼ã¹ãã«ããã¦ãã®åã示ãããããã¿ã¤ãã®è¤è£½ã§ãªãã¸ã§ã¯ããçæãããã¨ããç¹å¾´ã¯ãï¼ã¯ã©ã¹ãå¿ é ã®ã¯ã©ã¹ãã¼ã¹ã§ã¯ãã¯ã©ã¹ã new ã§ããã®ã«å¯¾ãï¼ã¤ã³ã¹ã¿ã³ã¹ãã¼ã¹ã§ã¯ã©ã¹ããªãã¨ãã«ä½¿ããããªãã¸ã§ã¯ãçæã®ããªã¨ã¼ã·ã§ã³ã®ã²ã¨ã¤â¦ã¨ããç¨åº¦ã®ä½ç½®ã¥ãã«ããããããã§ãªããã°ãªããªãã¨ããé¡ã®ãã®ã§ã¯ããã¾ããã
ãã®ãªãã¸ã§ã¯ãçæã«ããããããããã¿ã¤ããã¼ã¹ãé¢é£ã®ç¨èªã¨ãã¦ã¯ãããããã¿ã¤ãã¨ã¯ãã¼ã³ï¼ã³ãã¼ï¼ããããã¢ã¬ã³ãã¨ãã£ã¤ã«ããã¨ããç¨èªãããããã®é¢ä¿ãæ··ä¹±ã®å ã«ãªããã¡ã§ãããããããããªãªã¸ãã«ã¨ãã®æµ ãã³ãã¼ã®é¢ä¿ãªãããããã¿ã¤ãã¨ã¯ãã¼ã³ããå§è²å ã¨ãã¦ã®æ å ±ãæã¤ã ããªãããã¢ã¬ã³ãã¨ãã£ã¤ã«ããã¨çµ±ä¸ãã¦ã¯ã©ããã¨å人çã«ã¯æãã®ã§ãããç¾ç¶ããã¢ã¬ã³ãï¼ç§»è²å ã®ï¼ã¹ããããããããã¿ã¤ãããããã«æºããå¼ç§°ã¨ããè¨èªãå¤ãï¼é¢é£ãã¦ããããã¿ã¤ãã»ãã§ã¼ã³ããªãã¦è¨èããããããã§ããâ¦ï¼ã®ã§ãé£ããã§ããã
ãããã®ææ¡ãåãå ¥ãã¦ãããããªããã¤ã³ã¹ã¿ã³ã¹ãã¼ã¹çè¦ç¹ã«ããã¦ããã¿å ã®ãªãã¸ã§ã¯ãã®å¼ã³åã¯ãFunction.prototype ããã¢ã¬ã³ãã¨ãããªãã¸ã§ã¯ãããããã¯ãFunction.prototype ã®ãã£ã¤ã«ããã¨ããã®ããµããããã¨ãããã¨ã«ã§ãã¦ä¸ä»¶è½çãªã®ã§ããããªããªãããããããã«ããããªãã§ããããã§ããã°ããFunction.prototype ã移è²å ã«æã¤ãªãã¸ã§ã¯ããâ¦ããããï¼ã¨ã¯ããã.prototype ãããããæ±ï¼ã