Smalltalkåå¼·ä¼ã§å¤¢ãèªã£ã¦ã¿ã
シンコム・システムズ・ジャパンããã®ãªãã£ã¹ã§è¡ãããä»å¹´æå¾ã®Smalltalk勉強会ã§ç©å¹´ã®å¤¢ãèªã£ã¦ãããä»åã®åå¼·ä¼ã¯æ§ããã«è¨ã£ã¦ã言語の内臓丸出しの変態トークã°ããã ã£ãã®ã§ãããããªã®ä½ãããã§ããã£ã¦ã ãã®ç§ã®LT?ã¯ããªãæµ®ãã¦ãæ°ããããã©ããããªãã¨ã¯ï¼ï¾Îµï¾ï¼ããã·ãã¤ï¼ï¼
ã§ããã®å¤¢ãªãã ãã©ãè¦ããã«ãSmalltalkã£ã½ãæ¥æ¬èªããã°ã©ãã³ã°è¨èªãä½ããããã£ã¦è©±ãã ãã©ããã£ããã®å¤¢ãªã®ã§ããã§ã¯ããã«é¢¨åæ·ãåºãã¦ãä¸çä¸ã®äººã使ããå¤è¨èªåå¯è½ãªããã°ã©ãã³ã°è¨èªï¼ãã¼ã«ãä½ããããã£ã¦è©±ã«ãããã
ããå ¨ã¦ã®äººãããã°ã©ãã³ã°ã§ããã°ãã£ã¨ä¸çãããããæ®éã«çæ´»ãã¦ãã ãã§ãããã°ã©ãããå½¹æã§ãã¬ã¸ã§ãçªå£ã§ããYOUï¼èªååãã¡ãããªYOï¼ãã£ã¦æããã¨ãã©ãã ãå¤ããã
æ¥æ¬äººã¯èåçãé«ãã¦ç®æ°ãå¾æãªãã ããããã¾ãããã°èããã°ã©ã çã ã£ã¦ä¸çææ°ã«ãªããã¨ä¿¡ãã¦ãããã ãæ大ã®ããã¯ã¯ããã°ã©ãã³ã°è¨èªãåºæ¬çã«è±åèªã§æ§æããã¦ããã¨ã
ãã¡ããæ¥æ¬èªããã°ã©ãã³ã°è¨èªã ã£ã¦ããã¤ããããã©ãä¾ãã°ãドリトルãããなでしこããå ¨å¡ã使ããããã«ãªãã°æºè¶³ãã¨ããã¨ãæ£ç´æ¥æ¬ã§ããéç¨ããªãããã°ã©ãã³ã°è¨èªãå¼·å¶çã«è¦ããããã®ã¯å¾®å¦ããããããã°ã©ãã³ã°ãå ¨ãç¥ããªãããã¯ãããã©ãã»ã»ã»ã
ãããããªãã¦ãèªåãæ¬å½ã«æ¬²ããã®ã¯ãä¸çã«éç¨ããæ¥æ¬èªããã°ã©ãã³ã°è¨èªãã
ãããªæããã«å½¢å®¹çç¾ãã¦ãè¨èªã¯å®ç¾ä¸å¯è½ã ã¨è¨ããããã ãã©ãSmalltalkã£ã½ãããæ¹ï¼ãªãå®ç¾ã§ããããããªãããã¨ããã®ãä»åã®ææ¡ã
Smalltalkã«ã¤ãã¦å人çã«ä¸çªãã°ãããã¨æã£ã¦ããã®ã¯ãå ¨ã¦ãã¡ãã»ã¼ã¸éä¿¡ã§å®ç¾©ããã¦ãããã¨ãããSmalltalkã§ã¯ã¯ã©ã¹ãã¡ã½ããã®å®ç¾©ãç®è¡æ¼ç®ããå¶å¾¡æ§æã¾ã§å ¨ã¦ãã¡ãã»ã¼ã¸éä¿¡ã«ãªã£ã¦ãã
ããã§èãããã ãã©ãææ³ã«ã¡ãã»ã¼ã¸éä¿¡ãããªããªããä¾ãã°ãæ¥æ¬èªã£ã½ãã¡ãã»ã¼ã¸éä¿¡ã®è¨æ³ãï¼ã¨ãªãã©ã«ã®è¨æ³ãããã¤ãï¼ãå®ç¾©ãã¦ãã¼ãµã¼ãç¨æãããããã°ãå®éã®ãªãã¸ã§ã¯ãã·ã¹ãã ã¯Smalltalkã®ããã®ã¾ã¾ä½¿ãã ãã§æ¬æ ¼æ¥æ¬èªããã°ã©ãã³ã°è¨èªã¨ãã¦åä½ããããããªããã
ãæ¥æ¬èªã£ã½ãã¡ãã»ã¼ã¸éä¿¡ã®è¨æ³ãã¨ããã®ã¯ä¾ãã°ãããªæãã
åé ã¡ãã»ã¼ã¸
ã¬ã·ã¼ãã¼ ã¡ãã»ã¼ã¸
ä¾
ãæååãã®æåæ°ã
çµæï¼3
ã¬ã·ã¼ãã¼ï¼æåå
ã¡ãã»ã¼ã¸ï¼ã®æåæ°
ãã¼ã¯ã¼ãã¡ãã»ã¼ã¸
ã¬ã·ã¼ãã¼ å©è©ã å¼æ° å©è©ã å¼æ° ã¡ãã»ã¼ã¸
å©è©ã¨å¼æ°ã®çµã®æ°ã¯ä»»æã0ã®ã¨ãã¯åé ã¡ãã»ã¼ã¸ã«ä¸è´ããã
ä¾
ãããããããã®ã2 çªç®ã«ãããã²ã ãæ¿å ¥ããã
çµæï¼ããã²ãããã
ã¬ã·ã¼ãã¼ï¼ããããã
ã¡ãã»ã¼ã¸ï¼ã®ãçªç®ã«ããæ¿å ¥ãã
å¼æ°1ï¼2
å¼æ°2ï¼ãã²
å¶å¾¡æ§é
Smalltalkã¯å¶å¾¡æ§é ãã¡ãã»ã¼ã¸éä¿¡ãªã®ã§ãã¡ãã»ã¼ã¸ãã©ãå®ç¾©ãããã ãã©ãä¾ãã°é¸æã¯ãããªæãã«ã§ãããé¸æ
ããããããããã®æåæ° ãã5 ã«çãããã ãæ¬å½ãªãããã5æåã§ããããããå®è¡ããã
çµæï¼5æåã§ãã
ã¬ã·ã¼ãã¼ï¼ãããã¯ï¼ï¼ããããããããã®æåæ° ãã10 ã«çãããã
ã¡ãã»ã¼ã¸:ãæ¬å½ãªãããå®è¡ãã
å¼æ°ï¼ãããã¯ï¼ï¼ãã10æåã§ããããã
ããã°ã©ã ä¾
ã½ã¼ã¹ç¡ããã¡ãã£ããã©ãRubyã§ä»®ã«ä½ã£ã¦ã¿ãã¨ãã以ä¸ã®ããã°ã©ã ãåä½ãã¦ãã®ã§ãå®ç¾ã¯å¯è½ãªã¯ãã<<ãã®>> ã®ä¸ç¨®ã¨ãã¦ã <ããããã> ãä½ãã <<ããããã>> ã«ã¡ã½ããããã»ãã£ã(ããªãã®æ) ã¯ï¼ã ãå®ç¾©ããã対å¿è¡¨ 㯠{0âãã°ã¼ ãã»1âããã§ã ãã»2âããã¼ ã}ãããªãã®æ ãæ°å¤ã«å¤æãããããªãã®æ 㯠ãããç§ã®æ 㯠[0ã»1ã»2] ã®ãããããåæ 㯠ããªãã®æ ã¨ãç§ã®æ ã®å·®ã対å¿è¡¨ ã®ãããªãã®æ ã®å¤ã対å¿è¡¨ ã®ãç§ã®æ ã®å¤ã対æ¦çµæ 㯠ãã ã«ããã ãç¹ãããåæ ãã 0 ã¨çãããããªããã対æ¦çµæ ã«ããï¼å¼ãåãããç¹ããããããããªãã¨ããããåæ ãã 1 ã¨çãã ã¾ãã¯ã(åæ ãã -2 ã¨çãã) ãæãç«ã¤ãããªããã対æ¦çµæ ã«ããï¼ããªãã®è² ãããç¹ããããããããªãã¨ããããåæ ãã -1 ã¨çãã ã¾ãã¯ã(åæ ãã 2 ã¨çãã) ãæãç«ã¤ãããªããã対æ¦çµæ ã«ããï¼ããªãã®åã¡ããç¹ããããå®è¡ãããããå®è¡ãããããå®è¡ãããããå¦çããã <<ããããã>> ã«ã¡ã½ãããããéå§ããã ãå®ç¾©ãããããªãã®æ 㯠ãããã[ã0ãã»ã1ãã»ã2ã] ã«ãããªãã®æ ãå«ã¾ããï¼ããã¾ã§ããã0:ã°ã¼ã1:ãã§ãã2:ãã¼ãã表示ãããããªãã®æ ã <<ãã¼ãã¼ã>> ããèªã¿è¾¼ããããªãã®æ ã®æ¹è¡ãé¤ãï¼ãããç¹°ãè¿ããç§ ã»ãã£ãããªãã®æ ã¯ï¼ãããå¦çããã ããããã 㯠<<ããããã>> ã®å®ä½ãããããã ãéå§ãããçµæ ã表示ããã
å®è¡çµæ
0:ã°ã¼ã1:ãã§ãã2:ãã¼
0
ã°ã¼ ãã§ãï¼ããªãã®åã¡
ã¾ããã®ããã°ã©ã ãèªã¿ããããã©ããã«ã¤ãã¦ã¯ããããªæè¦ãããã¨æããã©ãå°ãªãã¨ãæ¥æ¬èªã ãããã£ã¨ã»ã³ã¹ã®ããã¡ãã»ã¼ã¸ã«ããã°ãã£ã¨èªã¿ããããªãã¨ä¿¡ãã¦ãã
ã¨ãããã¨ã§ãã¨ããããã®éæã¯Smalltalkç°å¢å *1ã§åä½ããä¸è¨ã®ãããªæ¥æ¬èªããã°ã©ãã³ã°è¨èªãä½ã£ã¦ã¿ããã¨ãããã¨ã
ã§ãããããé»æ³¢ã
ããã¤ãã®ãªãã©ã«ã¨ã¡ãã»ã¼ã¸éä¿¡ã®è¡¨è¨ã ããå®ç¾©ãã¦æ¥æ¬èªããã°ã©ãã³ã°è¨èªãå®ç¾©ã§ãããªããåæ§ãªããæ¹ã§ä¸å½èªã§ãã¢ã©ãã¢èªã§ããã©ããªï¼èªç¶ï¼è¨èªã®ããã°ã©ãã³ã°è¨èªã§ãä½ããã¯ããå¤è¨èªåã ããããªãã¦ä¾ãã°åä¾ç¨ã«æ¼¢åã使ããªãç°¡åãªè¨ãåãã ãã使ã£ãããã°ã©ãã³ã°è¨èªã¨ãã ã£ã¦å¯è½ã
ãã®ä¸ããããã¯åãè¨èªã®è¦ãæ¹ãå¤ããã ãã ãããå¯¾ç §è¡¨ããããã°ç¸äºã«ç¿»è¨³ãã§ãããå ã«æ¥æ¬ç¬èªã®è¨èªãåºããã®ã¯å¾®å¦ã¨æ¸ãããã©ãããã¯å®è³ªSmalltalkãè¦ãã¦ãããã¨ã«ãªãã®ã§å人çã«ã¯OKã
ãªã®ã§æ¬å½ã«å®ç¾ãããã¨ããã¯ããããããµãã«è¦ãç®ãããããã«å¤ããè¨èªãå®ç¾©ããããã®ã·ã¹ãã ãã§ãããã使ã£ã¦ä¸çä¸ã®äººãèªåã®æ¯å½èªã§ããã°ã©ãã³ã°ããããã«ãªãã¨ãããªã»ã»ã»
 ̄ ̄ ̄ ̄ ̄ ̄ ̄â ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ãããããããããããO ã ãããããããããããããããã , â㽠________ãããã/,/ï¼¼ã¾ï¼¼ ããï¼ï¿£ï¿£ï¿£ï¿£ï¿£ï¿£ï¿£ï¿£ï¿£ |__|__|__|_ãã __ï¼ï¼Â´âï½ï¼¼ãï¼ï¼ãã¨ããã話ã ã£ãã¨ãµ |_|__|__|__ãï¼ãã¸ã/''' ã)ã½ãã\_________ ||__|ããããããã | | \´-ï½ï¼ã/ã丿/ |_|_|ãä».ä»ä»ãã| ï¼¼__ ̄ ̄â|丿/ |__|| ä»äººäººä».ã|ã/\__/::::::||| |_|_|ï¼//ã½ã¾ï¼¼ã /ããã::::::::::::ã/|| ââââââââ(~ãã½::::::::::::|ï¼ããããããããï¼å® ï¼
*1:æ¢ æ¾¤ããã®Smalltalkåå¼·ä¼ã§ã®çºè¡¨ãè¦ãéãææ³ããããã®ã¯Smalltalkç°å¢ã®æµæã大ããããªã®ã§ãã¾ãã¯GNU Smalltalkã®æ¹é ãããã£ã¦ã¿ãã®ãããã®ããªã¨èãä¸