Shibuya.Lisp20091107View more documents from higepon.
ããããªãâ¦â¦ ããããªãâ¦â¦ R6RSã®Appendix Aã«è¼ã£ã¦ããå½¢å¼çæå³è«ãããããªãâ¦â¦ Schemeã®å½¢å¼çæå³è«ãç解ããããã®åéºã¯ã R6RSãå°å·ãã¦èªã¿ãªãããå®éã«Prologã¨ãã§ã æå³è«ã«ãã£ãã¤ã³ã¿ããªã¿ãä½ããã¨ã ããããªãâ¦â¦ ãããªé¢åãªãã¨ãããæå³ãããã®ãããããªãâ¦â¦ æ¬å½ã«ããã§ç解ã§ããã®ãã¯çè ãããããªãâ¦â¦ ããããããç°¡åã«èª¬æãããããããèãã¦ãã ãã©ãããã§ãR6RSãå°å·ããã»ãããããã ãããããR6RSã¯ãã¿ããªãã£ã¦ãããã®ãªã®ã§ã èªåã®ãã®ã ã¨åããããã«ãã¡ããã¨ååãæ¸ããªãã¨ã ããã ãããªã¾ãã·ã¼ã«ããè²¼ãã¨ããã®ãæãã ããã ãªã«ãããã® ãããã£ã±ã« ãããããããããã« ãã»ã ãããã ããããããããã ã¶ãã½ã ããããã¨ãã»ã ã·ããããã®ã¶ãã½ã ã¶ãã¿ããã¨ã㪠ã¶ãã¿ããã®
æãã¿ã¡ã«ãªããåå¿è ç¨è¨èªã㯠Pythonï¼ - 西尾泰åã®ã¯ã¦ãªãã¤ã¢ãªã¼ Schemeãªãããããããã¨ããããããã®ãããããã ããã¨ãããã§ãã¨ã¨ãå°é£ããã¦ãããããªããã®ããªããããåå¿è ã§ãå®å¿ãã¦ç°¡åã«ã§ããã > < ãããããããã«ã¼ãã¨å帰å¼ã³åºãã¨ã2ã¤ããã£ãºãã«è¦ããªãã¦ããæ«å°¾å¼åºã1ã¤ã ãè¦ããã°ä¸¡æ¹ã§ãã¡ãããï¼Schemeãããï¼ Schemeã§è±ããªè¡¨ç¾åã身ã«ã¤ãã ãªãã ãããããããªããã©ãå··ã®ããã°ã©ãã³ã°è¨èªã¯ * ã¨ã - ã¨ã ? ãå¤æ°åã¨ãé¢æ°åã«ã¤ãããªããæ¼ç®åï¼ãªã«ããåå¿è ã«ã¯é£ããã¦ããããªãï¼ï¼ Schemeã ã£ããããããã£ã¦ã·ã³ãã«ï¼ãã£ã¦èãé¢æ°ã¯ symbol? ã£ã¦ããååã«ã§ãããã is_symbolã¨ããããã«ããããï¼ï¼ï¼ã¢ã³ãã¼ãã¼ã¨ãã¿ã¤ããã«ããã¦åå¿è åããããªããï¼ï¼ï¼ åç §éæã§ããããªå¿
shiro ãããéçºããã¦ãã Scheme å¦çç³» Gauche 0.8.12 ã®æé©åå¦çãåå¼·ã®ããã«ã¾ã¨ãã¾ããã ãã Gauche ã®ã³ã¼ãã¯å®ã®å±±ã ã¨èãã¾ããããã®ä¸ç«¯ãåãã£ã¦ããããã¨ããããã§ãã åºæ¬çã«Gaucheã®ã³ã¼ãã®ã³ã¡ã³ããã¾ã¨ããã ãã§ãã Scheme ã®ã½ã¼ã¹ã³ã¼ãã¨ç°¡åãªè±èªãèªãã人ã¯ãã®ã¾ã¨ããèªããã src/compile.scm ãç´æ¥èªãã æ¹ãæ£ç¢ºã«ç解ã§ããã¨æãã¾ãã åæ1 ã³ã³ãã¤ã«ã¨å®è¡ã®æµã Gauche ã¯ã¹ã¿ãã¯ãã·ã³åã®ä»®æ³ãã·ã³ã§ã³ã¼ããå®è¡ãã¾ãã ãã®ãã Scheme ã®ã³ã¼ãã¯ã¹ã¿ãã¯ãã·ã³ã§å®è¡å¯è½ãªã³ã¼ãã«ã³ã³ãã¤ã«ããã¾ãã ã¤ã¾ã Scheme ã®ã³ã¼ã âï¼ã³ã³ãã¤ã«ï¼ ãã·ã³ã³ã¼ã âï¼å®è¡ï¼ çµæ ã¨ããæµãã§ã³ã¼ããå®è¡ããããã¨ã«ãªãã¾ãã ä»ååãä¸ãããæé©åã¯ä¸ã®æµãã®ãã³ã³ãã¤ã«
ã¡ãã£ã¨æ¯æãã« Scheme ã®åå¼·ã人ã®ã³ã¼ãèªã¿ æååã« a ã¨ããæåãå«ã¾ããã (define (has-a? string i) (and (>= i 0) (or (eqv? (string-ref string i) #\a) (has-a? string (- i 1))))) (has-a? "hoge" 3) ; => #f (has-a? "fuga" 3) ; => #t (define a "hoga") (has-a? a (- (string-length a) 1)) ; => #t JS ã«ç´ã㨠function has_a(string, i) { return i >= 0 && (string[i] == "a" || has_a(string, i - 1)); } ãªãã»ã©ã¼ã ãã¯ããæåãéãã¨æ¸ãæ¹ãéããªãã å帰å帰ã§é ãï¼ï¼
ã©ãæ¸ã?orgã®ã©ã¤ãã²ã¼ã ã®ãé¡(http://ja.doukaku.org/126/)ãGauche(Lispã®ä¸ç¨®ã§ããSchemeã®å¦çç³»)ã§å®è£ ãã¦ããéç¨ãåç»ã«ãã¦ã¿ã¾ãããLispãç¥ããªãã¨ä½ãã£ã¦ããã®ãããåãããªãã¨æãã¾ãããã²ããããé¢æ°ãæ¸ãã¦ã¯å®è¡ããç¹°ãè¿ãã¦ããã°ã©ã ãä½ã£ã¦ãã£ã¦ãã¾ããå®è£ æéã¯40åãããããã£ã¦ãã¾ãããåç»ã§ã¯æ©éãã§7åã¡ãã£ã¨ã«å§ç¸®ãã¦ãã¾ãããªããBGMã¯sm982882ãããåããã¾ãããã¾ããåç»ã§ä½¿ç¨ãã¦ãããã©ã³ãã¯ããããã©ã³ã(http://key.milkcafe.to/azuki/font/index.html)ã§ãã
æ¨æ¥ã¯ã1000speakers ã®ç¬¬1åã®ã¤ãã³ããããã¾ããã1次ä¼ã¯ Ustream ã«ã¦åå ãã2次ä¼ããç¾å°ã§åå ãã¾ããã 2次ä¼ã§SICPèªæ¸ä¼ã®è©±ã§çãä¸ãããæ°´ææ¥ã®èªæ¸ä¼ã«åå ãããã¨è¨ããã¨ã«ãªããamachang ãªã©æ°åã®æ¹ã ã«è²ã 㨠Scheme ã®æ¸ãæ¹ãæãã¦ãããã¾ããã 3次ä¼ã楽ããã£ãã§ãï¼23:30é ãããµã¤ãã¦ãºã©ãã«ã¦3次ä¼ãå§ã¾ã£ããã§ãããåãããã£ããæãã¦é ããã®ã§ãScheme ã®å®è£ ã JavaScript ã§å§ãããã西尾ãã(id:nishiohirokazu)㨠id:amachang ãåå ãå§ããå®è£ 大ä¼ã¨ãªãã¾ããã ãã®5æéã®ææããhttp://goldenscheme.accelart.jp/ ã§ãã å ¨å¡ãåºæ¬ææ³ã¯å®è£ ã§ãã¾ããï¼ï¼ å¦çç³»ãå®è£ ããã«å½ãããè¨èªãåãããä¸è¬è«ã¨ãã¦ãé£ããã®ã¯2ã«æã§ãã
æè¿ä¸é¨ã§çãä¸ãã£ã¦ãããæ«å°¾å帰ãã«ã¤ãã¦èªåã®ç解ã確èªããã®ãå ¼ãã¦æ¸ãã¦ã¿ã¾ãã ï¼ããããèªåããµã£ãã®ããã£ããã£ã½ãã®ã§ï¼ã ä¸ç´è ã®æ¹ã¯ééãçã«å³ããã¤ã£ããã§ããããã¨å©ããã¾ã:-) èæ¯ èªåãæ«å°¾å帰ãç¥ã£ãã®ã¯å¤åSchemeã®åå¼·ãå§ããé ã ã£ãã¨æãã¾ãã ä¾ãã°SICPã¨ããæ¬ã§ã¯20ãã¼ã¸ãããã«ãã£ããã¨åºã¦ãã¾ãã ãã®ããã®ç解ã¯ããªãæµ ããã®ã§ããµã¼ãããç¨åº¦ã§ããã ãã¦å¾æ¥Schemeã®å¦çç³»ãå®è£ ãããã¨ã«ãªãR5RSã¨ããSchemeã®ä»æ§æ¸ãèªãã ã¨ãã Scheme ã®å®è£ ã¯çæ£ã«æ«å°¾å帰ç(properly tail-recursive) ã§ãããã¨ãè¦æ±ããã¦ãããããã¯ï¼ãã¨ãç¹°è¿ãè¨ç®ã æ§æçã«å帰çæç¶ãã§è¨è¿°ããã¦ããã¨ãã§ãï¼å®æ°ç©ºé ã§ãã®ç¹°è¿ãè¨ç®ãå®è¡ãããã¨ãå¯è½ã«ãã ã¨ããæ«å°¾å帰ã®ãã¨ã詳ããç¥ãå¿ è¦æ§
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}