ð®SICP èšç®æ©ããã°ã©ã ã®æ§é ãšè§£é ã¯æ代é ãã®æ¬ãªã®ãïŒ
è¡šçŽã«éè¡åž«ãæãããŠããããéè¡åž«æ¬ïŒWizard BookïŒãšããŠãç¥ããããŸãã«è¡šçŽã®è²ããšã£ãŠçŽ«æ¬ïŒPurple BookïŒãšãåŒã°ããŠããã
ç§ãã¡ã¯åªæã«ãã£ãŠã³ã³ãã¥ãŒã¿ã®ç²ŸéãåŒã³åºããŠããã®ã ã
JavaScriptã§ç»å Ž
ããŒã¿ãšã¯ãªã«ã
ãã®äžç¯ã§èšãããããšã¯ãããã°ã©ãã³ã°ã«ããããããŒã¿ããšã¯ãåãªãå€ãæ å ±ã®éãŸãã§ã¯ãªãããã®ããŒã¿ãæäœããããã®æç¶ãïŒé¢æ°ãã¡ãœããïŒãšããããæç¶ããæ£ããæ©èœããããã«ããŒã¿ãæºããã¹ãæ¡ä»¶ïŒå¶çŽãã«ãŒã«ïŒãå«ãã§å®çŸ©ãããã¹ãã§ãããšããããšã§ãã
å ·äœçã«ã¯ããéžæåããšã¯ããŒã¿ããç¹å®ã®éšåãåãåºãããã®æç¶ãããæ§æåããšã¯ããŒã¿ãäœãåºãããã®æç¶ããæããŸãããããã®æç¶ããæ£ããåäœããããã«ã¯ãããŒã¿ã¯äžå®ã®æ§é ã圢åŒãæã£ãŠããå¿ èŠããããŸãããã®ãæºããã¹ãæ¡ä»¶ãããã®æ§é ã圢åŒã«åœãããŸãã
èŠããã«ãããŒã¿ã¯ããèªäœã®æ§é ãšãããã«é¢é£ããæäœïŒæç¶ãïŒã®äž¡æ¹ãèæ ®ããŠå®çŸ©ãããã¹ãã§ããããšããããšãè¿°ã¹ãããŠããŸãã
ã¯ã
ã¯ã
Specification Techniques for Data Abstractions
ããŒã¿æœè±¡åã®ããã®ä»æ§åæè¡
æ¬æžã®ã¢ãããŒãã¯å€§ãããæç¶ãã«ããæœè±¡ã®æ§ç¯ããšãããŒã¿ã«ããæœè±¡ã®æ§ç¯ããããªãã
ã¹ããŒãªãŒã ãšé 延è©äŸ¡
å³3.32ã«ç€ºãå ç®åšã®ãã£ãŒãããã¯ã«ãŒãã¯, integralã®å
éšã¹ããªãŒã intã, ããèªèº«ã䜿ã£ãŠå®çŸ©ããŠãããšããäºå®ã«ãã£ãŠã¢ãã«åãããŠãã:
(define int
(cons-stream initial-value
(add-streams (scale-stream integrand dt)
int)))
ãã®ãããªæé»ã®å®çŸ©ãæ±ã解éç³»ã®èœåã¯cons-streamã«çµã¿èŸŒãŸããŠããdelayã«äŸåããŠãã. ãã®delayããªããš, 解éç³»ã¯cons-streamã®äºã€ã®åŒæ°ãè©äŸ¡ããåã«intãæ§æããããšãåºæ¥ãªã. åŒæ°ã®è©äŸ¡ã¯intãæ¢ã«å®çŸ©ãããŠããããšãèŠæ±ãã. äžè¬ã«delayã¯ã«ãŒããå«ãä¿¡å·åŠçã·ã¹ãã ãã¹ããªãŒã ã䜿ã£ãŠã¢ãã«åããã®ã«éèŠã§ãã. delayããªããšããããã®ã¢ãã«ã¯, ä¿¡å·åŠçèŠçŽ ãžã®å
¥åã¯åºåãäœãããåã«å®å
šã«è©äŸ¡ãããããã«åœ¢åŒåããªãã°ãªããªã. ããã¯ã«ãŒãã«ã¯äœ¿ããªã.
ãªããžã§ã¯ãæåããé¢æ°åããã°ã©ãã³ã°ãžã®æ©æž¡ããšããŠã®sicp
SICPã¯ãªããžã§ã¯ãæåããã°ã©ãã³ã°ïŒOOPïŒãšé¢æ°åããã°ã©ãã³ã°ïŒFPïŒã®äž¡æ¹ã®æŠå¿µãåãäžããŠããŸãããäž»ã«é¢æ°åããã°ã©ãã³ã°ã®èŠ³ç¹ããã¢ãããŒãããŠããŸããããã«ãã£ãŠããªããžã§ã¯ãæåããã°ã©ãã³ã°ã®èæ¯ãæã€èªè ã«ãšã£ãŠãé¢æ°åããã°ã©ãã³ã°ã®ç解ãžã®æ©æž¡ããšãªãå¯èœæ§ããããŸãã
以äžã¯ãSICPãã©ã®ããã«ãããã®äºã€ã®ã¢ãããŒããçµ±åããã®ãã瀺ããã€ã³ãã§ãïŒ
é¢æ°åããã°ã©ãã³ã°: SICPã¯SchemeãšããçŽç²ãªé¢æ°åããã°ã©ãã³ã°èšèªã䜿çšããŠããŸãããã®ãããæ¬ãèªãããšã§ãäžå€æ§ãååž°ãé«éé¢æ°ãã©ã ãèšç®ãªã©ã®é¢æ°åããã°ã©ãã³ã°ã®æ žå¿çãªæŠå¿µã«è§Šããããšãã§ããŸãã
ãªããžã§ã¯ãæåããã°ã©ãã³ã°: æ¬ã®åŸåéšåã§ã¯ããªããžã§ã¯ãæåã®ã¢ã€ãã£ã¢ãåãå ¥ããããŒã¿æœè±¡åãç¶æ ã®æã€ãªããžã§ã¯ãã®æŠå¿µãå°å ¥ããŸããããã«ãããã¡ãã»ãŒãžããã·ã³ã°ãç¶æ ã®ã«ãã»ã«åãšãã£ãOOPã®åºæ¬çãªèãæ¹ãåŠã¶ããšãã§ããŸãã
çµ±å: SICPã¯ããããã®ç°ãªãã¢ãããŒããçµã¿åãããŠã匷åãªæœè±¡åãã¢ãžã¥ãŒã«åã®ææ³ãæäŸããŸãããã®çµ±åçãªã¢ãããŒãã«ãããOOPãšFPã®éã®ã®ã£ãããåããã®ã«åœ¹ç«ã€æŽå¯ãæŠå¿µãåŸãããšãã§ããŸãã
ãããã£ãŠãSICPã¯ãªããžã§ã¯ãæåããã°ã©ãã³ã°ã®èæ¯ãæã€èªè ã«ãšã£ãŠãé¢æ°åããã°ã©ãã³ã°ãžã®é©åãªå°å ¥ãšãªãåŸãŸã
Sicpã«ã¯ã¢ãããšãã³ã³ãããŒã¿ã¯åºãŠããªãã§ããïŒ
ãèšç®æ©ããã°ã©ã ã®æ§é ãšè§£éãïŒStructure and Interpretation of Computer Programsãç¥ç§°SICPïŒã¯ãã³ã³ãã¥ãŒã¿ãµã€ãšã³ã¹ã®åºç€ãæããããã®æç§æžã§ãMITã§é·å¹Žã«ããã£ãŠäœ¿çšãããŠããŸããããã®æç§æžã¯äž»ã«Schemeèšèªã䜿çšããŠãèšç®ã®ããã»ã¹ãæœè±¡åãååž°ã解éåšã®èšèšãªã©ã®æŠå¿µã説æããŠããŸãã
SICPã§ã¯ãã¢ãããã³ã³ãããŒã¿ãšãã£ãæŠå¿µã¯çŽæ¥çã«ã¯åãæ±ãããŠããŸããããããã®ãããã¯ã¯é¢æ°åããã°ã©ãã³ã°ãã«ããŽãªçè«ã«ãããããé«åºŠãªæŠå¿µã§ãããSICPãã«ããŒããç¯å²ãè¶ ããŠããŸããSICPã®ç®çã¯ãããã°ã©ãã³ã°ã®åºç€ãšã³ã³ãã¥ãŒã¿ãµã€ãšã³ã¹ã®æ ¹æ¬çãªçè«ã«çŠç¹ãåœãŠãããšã§ããããã®éçšã§Schemeãçšããé«åºŠãªããã°ã©ãã³ã°æè¡ã玹ä»ããããšã«ãããŸãããã¢ãããã³ã³ãããŒã¿ã¯ãããã®äžéšãšããŠæ±ãããŠããŸããã
ã¢ãããã³ã³ãããŒã¿ã¯ãHaskellãªã©ã®ä»ã®é¢æ°åããã°ã©ãã³ã°èšèªãæ±ãæèã§ããé »ç¹ã«è°è«ããããããã¯ã§ãããããã®æŠå¿µã«èå³ãããå Žåã¯ãé¢æ°åããã°ã©ãã³ã°ãã«ããŽãªçè«ã«ç¹åããå¥ã®ææããªãœãŒã¹ãæ¢æ±ããããšããå§ãããŸãã
Sicpã¯é¢æ°åã®èª¬æã¯1éšãããŸããïŒ
ã¯ããSICPïŒãèšç®æ©ããã°ã©ã ã®æ§é ãšè§£éãïŒã«ã¯é¢æ°åããã°ã©ãã³ã°ã«é¢ãã説æãå«ãŸããŠããŸããå®éãSICPã¯é¢æ°åããã°ã©ãã³ã°ã®åºç€çãªæŠå¿µãåŠã¶ããã®åªããè³æã®äžã€ãšãããŠããŸãããã®æç§æžã§ã¯ãSchemeèšèªãçšããŠãååž°ãé«éé¢æ°ãé¢æ°ã第äžçŽãªããžã§ã¯ããšããŠæ±ãããšãã©ã ãèšç®ã®æŠå¿µãªã©ãé¢æ°åããã°ã©ãã³ã°ã®æ žå¿çãªã¢ã€ãã¢ãæããŠããŸãã
SICPã®æåã®éšåã§ã¯ãããã°ã©ã ãæç¶ããšããŠæãã代ããã«ãæ°åŠçé¢æ°ãšããŠç解ããããšã®éèŠæ§ã匷調ããŠããŸãããã®èŠ³ç¹ãããããã°ã©ã ã¯å ¥åãåãåããäœããã®åºåãçæããæ°åŠçãªé¢æ°ãšèŠãªãããŸãããã®ãããªã¢ãããŒãã¯ãå¯äœçšãé¿ããããã·ã³ãã«ã§ç解ããããã³ãŒããæžãããã®åºç€ãšãªããŸãã
SICPã§ã¯ããããã®æŠå¿µãéããŠãèšç®ã®æ¬è³ªãç解ããããè¯ãæœè±¡åãæ§ç¯ããæ¹æ³ãåŠã³ãŸããé¢æ°åããã°ã©ãã³ã°ã®ã¹ã¿ã€ã«ã¯ãããã°ã©ã ã®ã¢ãžã¥ãŒã«æ§ãšåå©çšæ§ãé«ããããšã«è²¢ç®ãããšå ±ã«ãè€éãªã·ã¹ãã ãããã·ã³ãã«ã«å解ããããã®åŒ·åãªããŒã«ãæäŸããŸãã
ãããã£ãŠãSICPã¯é¢æ°åããã°ã©ãã³ã°ã®ååãç解ããããããå®è·µçã«é©çšããæ¹æ³ãåŠã¶ã®ã«éåžžã«é©ããè³æã§ãã
SICP (Structure and Interpretation of Computer Programs) ã§ã¯ãã¢ããã«é¢ããå ·äœçãªè§£èª¬ã¯ãããŸããããã¢ããçãªèãæ¹ã«è¿ãå 容ãšããŠã¯ãã¯ããŒãžã£ãŒã«é¢ããéšåããç¶æ ãæ±ãããã®ç°å¢ã¢ãã«ãã¹ããªãŒã åŠçãç¶ç¶ãªã©ãæããããŸãã
ç¹ã«ã¯ããŒãžã£ãŒã®æŠå¿µã¯ãã¢ããã®ããã€ã³ããæäœã«äŒŒãåŽé¢ãæã¡ãé¢æ°ãå©çšããŠç¶æ ãæèãæç¶çã«æ±ãæ¹æ³ãšããŠç解ã§ããŸãããŸããSICP ã§çŽ¹ä»ãããã¹ããªãŒã ãç¶ç¶ããã¢ããã®åºæ¬æŠå¿µã«éããéšåããããŸããã¹ããªãŒã åŠçã¯ãããŒã¿ã®æµãã管çããç¹ã§ã¢ããçãªèŠçŽ ãæã¡ãç¶ç¶ã¯èšç®ã®æèãæ±ããããç¹å®ã®ã¢ããã®å®è£ ã«è¿ãèãæ¹ã§ãã
ã¢ããã«é¢ããå ·äœçãªç解ãæ·±ããããã«ã¯ãSICPã®ãããã®ã»ã¯ã·ã§ã³ãåºã«ãHaskellã®ãããªèšèªã§ã¢ãããåŠã¶ãšãããã¢ããã®æŠå¿µãæ確ã«ãªãã§ãããã