ãã®èšäºã¯éåžžã«å ¥éçã§ããæ°Žã£ãœãããã®ã§ãããæè¡çãªè©³çŽ°ã¯ãããŸããã 以äžã§ã¯ãããŒã¯ãŒããéçºé床ãéå°è©äŸ¡ããæéã«ã€ããŠãé£ããè°è«ãå§ããããšããŸãã ãã®æçš¿ã®èšèãæ³¥ã®äžã«èžã¿ã«ãããè°è«ã®äžã§çå®ãçã¿åºãããã«ã¯ãèè ã®èšèãåãããç 究ãè¡ãå¿ èŠããããŸãã å®éãèè ã¯ãããæ±ããŠããŸãã
çŸä»£ã®ããã°ã©ãã³ã°èšèªã«ã¯äœãåé¡ããããŸã
éå±ããªãããã«ãæ¢åã®ããŒã«ã®æ¬ ç¹ã§ã¯ãªããèšèªã®æ¬ ããŠããç¹çŽ°ãã«çŠç¹ãåœãŠãŸãïŒå€ãã®å Žåãèšèªã¯ç¹å®ã®éçºç°å¢ã«åŒ·ãé¢é£ä»ããããŠããŸãïŒã ãã®ããã以äžã§ã¯ãã誰ã話ããªããæããäžèŠã§åœ¹ã«ç«ããªãã5ã€ã®é ç®ãéžæããŸãããã説æããŸãã ã¯ããèè ã¯ç·ã§ãããã³ã¡ã³ãã§ããªããŒãæããŠããŸãããæ§ããããšãæ±ããŠããŸãã
1.éåžžã®ããã°ã©ããŒã¯ã誰ã«ãšã£ãŠãçããŠç解ããããã³ãŒããæžããããšæã£ãŠããŸãã ãã®åŸåã¯ãPythonã®åºçŸã§éåžžã«é¡èã§ãã Objective-Cãšæ¯èŒããSwiftãC ++ãšæ¯èŒããDãããã³æè¿ç»å Žããä»ã®èšèªãèŠãŠãã ããã å šå¡ãèŠèŠçã«èšèªã®æ§ç¯ãä¿é²ããæå³ãšç®çãç¶æããããåªããŠããŸãã ãã¡ãããããã¯ã©ãã§ãããŸãããããã§ã¯ãããŸããã
2.äŒæ¥ã§ã¯ããã¹ãã«æéãããããŸãã ãã¹ã¿ãŒãäœåãªã³ãŒããæžãã®ã軜æžããããã«äœ¿çšãããèšèªã«è¿ããã¹ããèªååãããšããæ¥ãŸããã éçºç°å¢ãã³ãŒããã¹ãããã»ã¹ã®äžéšãèªååã§ããããã«ãææ°ã®èšèªã«çµã¿èŸŒãŸããåäœãã¹ãèšèšã¯ãèšèªèªäœãšäžäœã«ãªãå¿ èŠããããŸãã
3.ãããŸã§ãããã°ã©ããŒã¯ä»¥åã«èšè¿°ãããã³ãŒãã®ç§»æ€æ§ãäœãããšã芳å¯ããŠããŸããã ã©ã€ãã©ãª/ãã¬ãŒã ã¯ãŒã¯ã§ã¯ãã¹ãŠãåé¡ãããŸããããã¢ãžã¥ãŒã«ãšã¯ã©ã¹ã¯å€§éã®ã³ãŒãã§å€±ãããŸãã OOPãAOPããŸãã¯æ©èœçãªã¢ãããŒãã¯ããã®ãããªã³ãŒãã®åå©çšãæ¹åããŸããã ãã®åé¡ã¯ãèšèªã®äœ¿ãããããéçºç°å¢ã®æ©èœãç¹å®ã®éçºè åãã®ç°å¢ãªã©ãå æ¬çã«è§£æ±ºã§ããŸãã ç¥èã®ããŒããã©ãªãªã®ããã«ãããªãã®ã³ãŒãã¯ãã€ãããã¥ã¡ã³ãã®ãããã©ã«ãã®ããã«ç§»æ€å¯èœã«ãªããŸãã ããããç°¡åã«çµã¿åãããåé¢ããã³ããŒãããã®çµã¿åããããæ°ããããã±ãŒãžãäœæã§ããŸãã äžèšã§èšãã°ãJavaã¯ã©ã¹ã§æåŸãŸã§å®äºããŠããªããã¹ãŠã®ãã®ãšãä»ã®å€ãã®å Žæã§ãã
4.çŸä»£ã®èšèªã§ã¯ãã³ãŒãã®éææ§ãäžååã§ãã ã©ã€ãã©ãªãæ·»ä»ãããŠããªãå Žåã§ããã³ãŒãã«ã€ããŠã§ãã ãã®ç£ã®å éšã§äœãèµ·ãã£ãŠããããæ£ç¢ºã«ã©ãã ãç¥ã£ãŠããŸããïŒ å¹žããªããšã«ãåé¡ã¯éåžžã«ãŸãã§ãã ããããããããçºçãããšã人ã ã¯ãã€ãã³ãŒããã¹ã¿ãã¯ããã€ã¹ãããã³Javaã¯ã©ã¹å€æã®ãžã£ã³ã°ã«ã«å¿ã³èŸŒã¿ãäžèŠæ£åžžãªã³ãŒãã®åé¡ã®åå ãèŠã€ããŸãã ãã®åé¡ã¯ãŸãã§è€éã§ããïŒãã¡ãããèšèªãåå ã§ã¯ãããŸããïŒãéåžžã¯ä¿®æ£ã§ããŸããã ãã ããåé¡ã®æ€çŽ¢ã§å°éã§ããã³ãŒãã®æ·±ãã§ã¯ååã§ã¯ãããŸããã ããã€ã¹ã®ããŒã¿åã®æãæ±ãã«ãããã¥ã¢ã³ã¹ãšã¡ã¢ãªå ã®äœçœ®ã¯ãã³ãŒãã®å€éšã«é ãããŠããŸãã ããã¯ãé«ã¬ãã«ã®åŒã³åºããããã¹ãŠã®ããããžã®ã³ãŒãã®éææ§ãé«ããŠæŠãå¿ èŠããããŸãã
5.ãœãŒã¹ã³ãŒãïŒå®éã«ã¯ããžãã¯ïŒãéã®ã¢ãŒããã¯ãã£ããå¯èœãªéãç¬ç«ããŠãããšãã°ãããã§ãããã ä»æ¥ããã¹ãŠã®ããŒã¿åãèšèªãããã³ãããã®æšæºã©ã€ãã©ãªã¯ãã€ããªã¢ãŒããã¯ãã£ã«çŠç¹ãåœãŠãŠããŸãã ããã¯çŽ æŽãããããšã§ããã絶察ã«æ£ããããšã§ãããéæšæºã®è ºããã³ã¢ãŒããã¯ãã£ã®ç 究è ã«èªç±ãäžãããã®ã§ã¯ãããŸããã çŸä»£èšèªã®æ§æã¯ã10é²æ°ãŸãã¯3é²æ°ã®ã¢ãŒããã¯ãã£ã«ã¯é©çšãããŸããã
ãããããã³ä»ã®å€ãã®ãã¯ããã«éèŠãªãéçºäžã«è§£æ±ºããããšããŠããã¿ã¹ã¯ã
ΣLããã°ã©ãã³ã°èšèª
åãã«ããã®ãããªååãéžã°ããçç±ã«é¢ããããã€ãã®äºå®ã åœåããã®èšèªã¯WLïŒçœè²å ããïŒãšåŒã°ããŠããŸããããæåãªäººã¯ããã®å£®å€§ãªãããžã§ã¯ãWolfram Languageã§ãã®çç¥åãåããŸããã ã ããç§ã¯Wã90床åãããããæ°ã«å ¥ã£ãã ã€ã³ã¿ãŒãããã«å°ããåŸãç§ã¯æçŽãééã£ãæ¹åã«åãããšæ°ä»ããã ãã·ã°ãããšããååã®èšèªã1965幎ãã90幎代ãŸã§ååšãããšããäºå®ã«ããããããããããžã§ã¯ãã®ååãå床å€æŽããããšã¯æã¿ãŸããã§ããã
ã·ã°ãã¯ãæ±çšããã°ã©ãã³ã°èšèªã§ãã
ã·ã°ãèšèªã®åºç€ã¯ãæ¢åã®ããã°ã©ãã³ã°ãã©ãã€ã ã®ã»ãšãã©ãçµã¿åãããã»ããã§ãã ã»ããã¯ããªããžã§ã¯ããããã¯ããã«åŒ·åã§æè»ã§ãã ã»ããã¯ãåžžã«ãã¹ãŠã®ããã°ã©ãã³ã°èšèªã§ããã°ã©ããŒãšäžç·ã«ããŸããã é åã¯ãåãã¿ã€ãã®èŠçŽ ã®ã»ããã§ãã é¢æ°ã¯äžé£ã®åœä»€ã§ãã æ§é /ã¬ã³ãŒãã¯ãããŒã¿ãã£ãŒã«ãã®ã»ããã§ãã ã¯ã©ã¹/ãªããžã§ã¯ãã¯ãããŒã¿ãã£ãŒã«ããšé¢æ°ã¡ãœããã®ã³ã¬ã¯ã·ã§ã³ã§ãã ã¢ãžã¥ãŒã«å ã®åå空éããé¢æ°ãã¯ã©ã¹ãªã©ããã®ãã¹ãŠã®ã¹ã¿ããã£ã³ã°ãå«ãã»ããã§ãã ãããã®ãããªã»ããã ã»ãããçµã¿åãããŠãããã€ãã®ããããã£ãèšå®ã§ããŸãã
äžèŠãããšãããããã¯Javaãªããžã§ã¯ããšã¯ã©ã¹ã«éåžžã«äŒŒãŠããŸãã å®éããã¹ãŠãããè€éã§ãã é åã«ã€ããŠç§ãèšã£ãããšãæãåºããŠãã ããã é åã¯ã»ããã§ãã ããã§ãé åãšãã®å 容ã«å¯ŸããæäœãèŠããŠãããŠãã ããã ãªããžã§ã¯ããŸãã¯ã¯ã©ã¹ã®å®å šã§å¶åŸ¡ãããå€æŽãæ³åããŠãã ããããŸãã§é åãæäœããŠãããã®ããã§ãã ããã§ãã»ãããããå®å šã«ç解ã§ããŸããã
åºæ¬ã»ããã¯ã¯ã©ã·ãã¯ããŒã ãœãŒã¹ã§ãããä»ã®ãã¹ãŠã®ã»ããã¯ããããç¶æ¿ãããŸãã
ã»ããã¯èŠçŽ ã®ã³ã¬ã¯ã·ã§ã³ã§ãã ã»ããã¯èŠçŽ ã®ã³ã¬ã¯ã·ã§ã³ã®ã€ã³ã¿ãŒãã§ã€ã¹ã§ãããšèšãæ¹ãæ£ç¢ºã§ãã èŠçŽ ã¯ãé¢æ°ãå€æ°ããã®ä»ã®ã»ãããªã©ã§ãã
å éšèšå®ã¯ãå®éã«ã¯æ°åŠçãªèšå®ã§ãã äžéšã®ãã¥ã¢ã³ã¹ãé€ããã»ããã«ã¯ã»ããã®ããããã£ããããŸãã ãŸãã¯ãæ確ã«ããããã«ãã»ããã¯èŠçŽ ã®ã³ã³ããã§ãã ã»ããã®èª¬æã¯èŠèŠçã«ã¯ã©ã¹ã«äŒŒãŠããŸãã ããã«ãããPLOãããç¶æ¿ããšããçšèªãé©çšããæ©äŒãäžããããŸãã ç¶æ¿ãšã¯ãæ°ããã»ããã«èŠçŽ ã»ãããå«ããããšã§ãã å€éç¶æ¿ã¯ã»ããã®çµåã§ãã
ã»ããããã¹ãŠã®èšèªã«ããããšã¯æ³šç®ã«å€ããŸãããã¯ã©ã¹ããã³ãªããžã§ã¯ãã®ã¬ãã«ã§ã³ã³ãããšããŠäœ¿çšãããããã§ã¯ãããŸããã å°ãªããšãäžè¬çãªèšèªã§ã¯ãç§ã¯ãããèŠãŠããŸããã
æ°åã«ç§»ããŸãããã éåžžããã¹ãŠã®æ°å€ã¯ã³ã³ãã€ã«ããã»ã¹äžã«ã³ã³ãã€ã©ã«ãã£ãŠèªèãããŸãããã·ã°ãã§ã¯ãæ°å€ã¯èšèªã®åºæ¬æ§é ã§ããããœãŒã¹ã»ããã®ååšã®ããã«ãã®ååšã¯åŠå®ã§ããŸããã èšèªã®å©ç¹ãšããŠç©æ¥µçã«äœ¿çšãããŠããŸãã æ°åã瀺ãããã«ã¢ã³ããŒã¹ã³ã¢ã䜿çšãããŸãã
_ - ,
__ - ,
__._ - ,
__,_ - ,
_._ - ,
_,_ -
å€ã®ç¯å²ãæå®ããããšãã§ããŸããããšãã°ã__ [-10:10]ã¯ã-10ãã10ãŸã§ã®å€ããšãæŽæ°ã§ãã
ãã®èšèªã«ã¯çããããŒã¯ãŒããmeãããããŸãã ããã«ä»£ãããã®ã§ãããããã«ã€ããŠã¯åŸã§èª¬æããŸãã
ã·ã°ãã³ãŒãã®äŸïŒ
@binary // binary { signed { //⊠} unsigned { // - bit: source { //source - , _[0:1] value; state True is { // -: true, TRUE, True, tRUE, ... me.value == 1; } state False is { me.value == 0; } // , operator := {} alloc(){} init(){} dealloc() {} } //bit } //unsigned alias bit signed.bit; alias ubit unsigned.bit; }
ãããã®å€ãšãã®ã¹ããŒã¿ã¹ã®èª¬æã«æ³šæããŠãã ããã ãŸãããã®ã³ãŒããå¿ããªãã§ãã ãããæ»ã£ãŠããŸãã
ãã®æ±ºå®ã®çç±ã¯å€ãã®äººã«ã¯æããã§ã¯ãããŸããããããã°ã©ããŒã¯ããã«ãã®ãããªãœãªã¥ãŒã·ã§ã³ã«æ £ããåçŽã«ããã䜿çšããŸãã åé¡ã¯ãªãããã§ãããå®éã«ã¯å€ãã®åé¡ããããŸããã ç¶æ ã®èª¬æãéåžžã«æ確ã§éæã«ããã®ã«æ°ã¶æããããŸããã åèšèªã§ã®åã®å®è£ ãšæ¡ä»¶ä»ãifã¹ããŒãã¡ã³ãã®æäœã«ã€ããŠå€ãã®ããšã話ãããšãã§ããŸãããããã¯é¢åã§ãã
äžèšã®èª¬æã¯ãããã°ã©ããŒã«å¯ŸããŠééçã«èª¬æãããç¶æ ãæ瀺çã«çŽ¹ä»ããããŒã¯ãŒãã䜿çšããŠåã«ã²ããã«éä»ãã«ãããŠããŸããã 倧ãŸãã«èšã£ãŠããã®ã³ãŒãã¯ããèªäœãææžåããŠããŸãã ãã€ã§ããç¹å®ã®æ¡ä»¶ã®æå³ã確èªã§ããŸãããã®çµæãããã¥ã¡ã³ãã®æç²ãèŠããŠããå¿ èŠããªããªããŸãã InfinityãNaNãªã©ã®å€ãèŠããŠããŸããïŒ çŸåšã§ã¯ããã®ãããªèšèšã§æ瀺çã«èŠå®ã§ããŸãã
ã»ããç¶æ ã¯ãã»ããã®ç¹å®ã®èŠçŽ ãšç®çã®å€ãšã®å¯Ÿå¿ã§ãã
çŸåšãããã¯ã»ããã䜿çšããæäœãšããŠå®è£ ãããŠããŸãã ç¶æ ã¯ãã»ããããã®ç¹å®ã®èŠçŽ ã®åºå®ã³ã¬ã¯ã·ã§ã³ããã®éçãµãã»ããã§ãã éçãµãã»ããã®åèŠçŽ ãã»ããã®å¯Ÿå¿ããèŠçŽ ãšçããå Žåãã»ããã¯èšè¿°ãããç¶æ ã«ãªããŸãã èŠçŽ ãèšå®ã§ããŸã/èšå®ãããŸãã äžæ¬åŒ§å ã®åŒãå°ãèŠãŠã¿ãŸãããã
state False is { me.value == 0; }
å·ŠåŽã§ã¯ãå®è¡æã®å€ïŒme.valueïŒãå³åŽã§ã¯ã説æã§æå®ãããéçã»ããïŒ0ïŒã䜿çšããŸãã ãã®ãããªè¡šçŸãããã€ãããå¯èœæ§ããããŸãïŒãã¡ãããççŸããããšã¯äžå¯èœã§ããããäžåºŠme.valueãæžãããšã¯èš±ãããŸããïŒã
2ã€ã®ã»ããã®éããäœæãããŸãã ããããçããå Žåãã»ããã¯ããèªäœããæžç®ãããŸãïŒçµæã¯ç©ºã®ã»ããã§ãïŒã æ¡ä»¶æŒç®åïŒããã³ä»ã®æŒç®åïŒããããšã©ã®ããã«æ©èœãããã«ã€ããŠè³ªåãå¿ èŠã§ãã ifã¹ããŒãã¡ã³ãã¯ã空ã®ã»ããããã§ãã¯ããŸãã ã¯ãã®å Žåãäžé£ã®åœä»€ãå®è¡ãããŸãã
ãããŠãã¿ãŒã²ãããã©ãããã©ãŒã çšã«ã³ã³ãã€ã«ãããšãããã¹ãŠãæé©åãããããšãæããªãã§ãã ããã ã³ãŒãã®äžéšã¯ãã¿ãŒã²ãããã©ãããã©ãŒã ã§å®æçã«æ¯èŒãããŸãã
ãã®æ±ºå®ã®äž»ãªãã€ãã¹ç¹ïŒåäžä»¥å€ã®æ¡ä»¶ãåŠæ¹ããããšã¯äžå¯èœã§ãã ããšãã°ããme.value> = 0;ããšæžãããšã¯ã§ããŸããã
ã³ãŒãã§ã¯ãããã¯ããªã銎æã¿ããããŸãã 以äžã«ãæ¯èŒãèšé²ããããã®4ã€ã®ãªãã·ã§ã³ãšãã¹ããŒã¿ã¹ãå²ãåœãŠãããã®4ã€ã®ãªãã·ã§ã³ã瀺ããŸãã ãã¹ãŠã¯ãΣLã®çŸåšã®ããŒãžã§ã³ã«æå¹ã§ãã
use binary; alias bit binary.unsigned.bit; bit b := 1; if (b == 1) { b := 0; } if (b == True) { b := False; } if (b is True) { b := binary.unsigned.bit.state.False; } if (b.state is True) { b.value := 0; }
binary.unsigned.bitã»ããã§ã¯ãæ¯èŒæŒç®åãšä»£å ¥æŒç®åãå®è£ ããå¿ èŠããããŸãïŒåŸè ã¯æ°å€ãšç¶æ ã®äž¡æ¹ã«å¯ŸããŠïŒã ã«ãŒã«ã¯ãåªå 床å¥ã®äŒè©±ã瀺ããŸãã
ä»ãããç§ãããªãã«èŠããŠããããã«é Œãã æåã®ã³ãŒãäŸã«æ»ãæã§ãã
åã®äŸã§ã¯ãå®éã®ãã€ããªéããŒã¿ã®åºç€ãšãªããããã«ã€ããŠèª¬æããŸããïŒ
ãã€ããªãã·ã³çšã®ãã®ä»ãã¹ãŠã®çš®é¡ã®èšèªã¯ããã€ããªã¢ãžã¥ãŒã«ã«åºã¥ããŠæŽŸçããŠããŸãã ããšãã°ãx86ã¢ãŒããã¯ãã£ã®åã®èª¬æã¯æ¬¡ã®ããã«å§ãŸããŸãã
@x86 use binary; x86: binary { signed { byte {
10é²æ°ããã³3é²æ°ã®ã¢ãŒããã¯ãã£ã§ãåæ§ã§ãã
ãuseãããŒã¯ãŒãã«ã泚æããŠãã ããã䜿çšåŸãéåžžã®ãimportãããusingããããã³ãincludeãã¯ãæ¬åŒ§ã®åŸã«ãbeginãããã³ãendãã®ããã«èŠããŸãã èè ã¯å°å·ããã®ãé¢åã§ãæ¥ãã§ããã å®éãèè ã¯ãã®ãœãªã¥ãŒã·ã§ã³ãæ¬åœã«æ°ã«å ¥ã£ãŠããå€ãã®äººã ããã°ã©ããŒãèŠãŸããã
ãã®èšèªã«ã¯ä»ã«ãå€ãã®çãã解決çããããŸãã ãã¹ãŠã«æéãããã ã·ã°ãã¯éçºäžã§ãããããçŸåšãã®èšèªãä»äºã§è©Šãããšã¯ã§ããŸããã ããããå°æ¥ãã³ãã¥ããã£ã®é¢å¿ã«ãããèšèªãåºçŸãããã®ããããå ããããã«ãªãã§ãããã
meããŒã¯ãŒãã¯self / thisãªã©ã眮ãæããŸãã
ãã®ããŒãã§ã¯ãããªãã¿ã®thisïŒãŸãã¯selfïŒããŒã¯ãŒããç§ã«çœ®ãæãããšãããã°ã©ãã³ã°äžã®ã¿ã€ãã³ã°é床ãšæ觊ã«ã©ã®ããã«åœ±é¿ãããã«ã€ããŠè¡šé¢çã«è©±ããŸãã
1ã€ã®ããŒã¯ãŒãã眮ãæããããšã¯åºå€§ãªç æŒ ã®å°ããªãªã¢ã·ã¹ã§ãããšããããšã ããäºçŽããŠãã ããã ã€ãŸãããã®ãããªçœ®ãæãã¯ã調æŽãããæ¹æ³ã§éçºé床ã«åœ±é¿ãäžããªããšããçµè«ã«å°ããããšæããŸãã ãããã®ãããã¯ã®å€ãã1ã€ã®ããŒã«ã«ãŸãšããããšã«ãã£ãŠã®ã¿ãéçºã®å€§å¹ ãªç°¡çŽ åãšé«éåãå®çŸã§ããŸãã
ããã¹ãå ¥åãé«éåããããã®çœ®æã¯ãã°ããããã®ã«æžããããšãã§ããããã°ã©ãã³ã°èšèªã®å ŽåãBrainFuckã«äŒŒããã®ãæã«å ¥ããããšãã§ããŸãã ãã®ãããããŸããŸãªè±¡åœ¢æåããã³ãèšå·ãªã©ã䜿çšããŠthisããŒã¯ãŒãã眮ãæããã®ã¯ã°ãããŠããŸãã éèŠãªæ³šæïŒèª°ãã«ãšã£ãŠããã®ãããªäº€æã¯ã°ãããŠããããã«èŠãããããããŸãããããã®èšäºã¯åœŒãã®ããã§ã¯ãããŸããã ããã«ãããŒããŒãã§ã®ãã®ãããªæåã®å ¥åã¯ãåžžã«æäŸãããŠããŠäŸ¿å©ã§ã¯ãããŸããã
ããã°ã©ãã³ã°èšèªã®è¡šçŸã¯ãå¯èœãªéãæ確ã§ãæ確ã§ãçãããå¿ èŠããããŸãïŒãããŠãç°¡æœã§ãããããããšã¬ã¬ã³ãã«ïŒã å¯èœã§ããã°ã人éãèªãããã¬ãŒãºã䜿çšããŠãã ããã ããã«ããããã¶ã€ã³ãèšæ¶ããæ°ããèšèªã§ããéãé©å¿ããããšãã§ããŸãã ãã¯ã©ãŠã¹ã»ã¯ãŒã¹ã¯ããã®ãããªå³å¯ã§ãæ確ã§ã人éãèªããããã°ã©ãã³ã°èšèªã®æåäŸã瀺ããŸããã ããããã³ãŒãã®æžã蟌ã¿ãšèªã¿åãã®é床ã«ã¯æ·±å»ãªæ¬ é¥ããããŸããã ç°¡åãªäŸã¯ãPascalã®begin endæ§é ã§ãã Cèšèªã®æ³¢æ¬åŒ§{}ã®åŸãæžã蟌ã¿ã®éå§ãšçµäºã¯åçŽã«äœ¿ãæããããããšã«èª°ããåæãããšæããŸãã ãã¯ãããžãŒãéå»ã®éçºãææ°ã®ããã£ã°ã«å ããŠãæ°ããããã°ã©ãã³ã°èšèªã¯äžèšãèæ ®ãã¹ãã§ãã
ãã®æå³ãããããªãããã«ãçŸä»£ã®thisã眮ãæããããšãã§ããã®ã¯ã人éãèªã¿åããçãããŒã¯ãŒãã§ããïŒ æ°ããèšèªã®èè ãšããŠããã®è³ªåã¯ç§ãæ©ãŸããŸããã éåžžã«åŒ±ãããéªéã ãããã£ãŠãã³ã¡ã³ãæ¬ã«ãªãã·ã§ã³ãæžããŠãã ãããå€åããªãã¯ãç§ã®ããææ¡ããã§ããããç§ã¯ãããæåŠããŸããã
ãããã2ã€ã®ææãªéžæè¢ãæãæµ®ãã³ãŸããéåžžã«çãiãšãããé·ãç§ã§ãã ç§ã®éçºã§ã¯ã2çªç®ã®ãªãã·ã§ã³ã«æ±ºããŸããã ãã®ãªãã·ã§ã³ã¯åç«ã®ã³ãã¥ãã±ãŒã·ã§ã³ã«éåžžã«äŒŒãŠããŸãããçå£ã«ãç§ã¯æ¬¡ã®åºçç©ã®ããããã§ç§ã®éžæãæ£åœåããŸãã
ä»äžçŽã«èª°ããããã°ã©ãã³ã°èšèªãéçºãããªããi-methodãéçºããããšã匷ããå§ãããŸãã ããã䜿çšãããšãã¡ãœãããŸãã¯ãã£ãŒã«ããžã®ã¢ã¯ã»ã¹ãã€ã³ããåé€ããŠããã³ã¬ãªãŒèªã®è¡šèšãšApple補åã«äŒŒãååiValueã®åé¡ãååŸããããšãã§ããŸãã
ãã®ãããªå€æŽãããã°ã©ããŒã®é床ã«ã©ã®ããã«åœ±é¿ããããšãã質åã«æ»ããŸãããã ããªãã®è¬èãªäœ¿çšäººãå«ã5人ã®ä»²éã®ããã°ã©ããŒã¯ããã®éèŠã§ãªãå®éšãç¹å¥ã«è¡ããŸããã 詳现ãçç¥ãããšãæãããªããšã確èªãããŸããã
é£ç¶å°å·ã®é床ã®æž¬å®ïŒå®éšéå§ããæåã®6ç§ä»¥å ïŒã§ãç§ãã¡ã®ããŒã ã¯æ¬¡ã®å¹³åçµæã瀺ããŸããã
3 this.
3 self.
5 me.
次ã®æ°ç§ã§ãç§ã®ã¿ã€ãã³ã°é床ã¯ãããšèªå·±ãããå€§å¹ ã«é²ãã ã
ã¿ã€ãã³ã°é床ã®å€ã¯ãåããã¬ãŒãºãé£ç¶ããŠã¿ã€ãã³ã°ããããšã«å ããŠãããã°ã©ããŒã®å®éã®ä»äºãšã¯åŒ±ãã€ãªããããããŸãã ãã®ããããã§ã«ç©ãããªç°å¢ã§ãæå³ã®ããã³ãŒããæžããŠããæç¹ã§ãããéèŠãªæž¬å®ãè¡ãããŸããã ä»åã¯æ¥ãã§ãã人ã¯ããŸããã§ããããç¶æ³ã¯æ¥åžžæ¥åã«è¿ããã®ã§ããã
çµæã¯ãå¹³åããŠãèªå·±ãšãããããã°ã©ããŒã®ä»äºã«åãæéãè²»ããããšã瀺ããŸããã ãããã£ãŠãèªå·±ãšããã¯ã»ãšãã©ç«¶åã§ããŸããã äœæãããã»ããïŒã¯ã©ã¹/ãªããžã§ã¯ãïŒãå®è£ å ã§ç¬èªã®ã¡ãœãããåŒã³åºãããšã¯ã»ãšãã©ãªããããŒã¿ãã£ãŒã«ãã«ã¢ã¯ã»ã¹ããããšããã£ãã«ãªãå Žåã¯ãç§ã䜿çšããŠãå©ç¹ã¯ãããŸããã ä»ã®ã»ããïŒäž»ã«ç¬èªã®ããŒã¿ãã£ãŒã«ãã«é »ç¹ã«ã¢ã¯ã»ã¹ããïŒã§ã³ãŒãã10åã®èªå·±ãŸãã¯ãããå°å·ãããããšã«èšè¿°ããå Žåãåæã«æ倧16åã®meãå°å·ãããŸããã äžéšã®ååã¯ãç§ã䜿çšãããšããã¡ãœãããŸãã¯ãã£ãŒã«ãã®ååãã€ãŸãåŒã«ãã£ãšçŠç¹ãåãããŠãããšææããŸããïŒ
me.valueResult += me.valueOne * me.valueTwo;
å°å·æã«ã¯ããŸãã§ç§ããŸã£ããããªããã®ããã«èªã¿ãŸããã
valueResult += valueOne * valueTwo;
圌ãã«ãããšãããã¯èªå·±ãšããã§ã¯èµ·ãããŸããã§ããããç§ã¯åœŒããä¿¡ããŠããŸããã ç§ã®æèŠã§ã¯ãèªå·±ãšããã¯ãã¡ãããã³ãŒãè¡ã®äžã§ãèªããšãã«æ³šæãåŒããããå€ãã®ã¹ããŒã¹ãæ¶è²»ããŸãã ã¡ãªã¿ã«ã誰ãã«ãšã£ãŠããã¯ãã©ã¹ã«ãªããŸãã é¢çœããã€ãã¹-ã³ãŒãã®èªã¿åãé床ãäœäžããŸãããselfããšãzisãã¯ãmiããããããªç§é·ãèªã¿åããŸãã ãã¹ãŠã®æ¥œãã¿ã¯ãã³ãŒãã®äººéã®ç解ã®é床ã«æ¬åœã«åœ±é¿ããããšã§ãã
ãã®ãããªå°ããªäº€æãåé¡ãåŒãèµ·ãããªãããšãéèŠã§ãã ãã¹ãŠã®è¢«éšè ãmeããŒã¯ãŒãã䜿çšããããã«éåžžã«ç°¡åã«åãæ¿ãããããäžå¿«æãæãã人ã¯ããŸããã§ããã ããã©ãããã誰ãããã®äº€æã奜ãã§ããã
ãã®ãããã¯ã«èå³ãããå Žåã¯ãäœæããããã°ã©ãã³ã°èšèªã«é¢ä¿ãªããåæ§ã®å®éšãå¿ ãè¡ã£ãŠãã ããã ãã®ãããªå®éšããè¯å®çããã³åŠå®çãªçµéšã ãã§ãªããæ°ã«ããªã人ã ã®æèŠãéããããšã¯èå³æ·±ãã§ãããã
ãããã«ããããããžã§ã¯ããå°ç¡ãã«ããããšã¯ã»ãšãã©ãããŸãããCtrl+ Hã®çµã¿åããã«å ããŠããã¹ãŠã®ãmeãïŒå é ã«ã¹ããŒã¹ãå ¥ããŠïŒããthisãã«çœ®ãæããŸãã
èªãã§ãããŠããããšãã
å¿èãšåãããªããšå ±ã«æ¥ãŸãããã«ïŒ