<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="http://wiki.dgoon.net/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel>
        <title>D-Goon's Doc</title>
        <description></description>
        <link>http://wiki.dgoon.net/</link>
        <lastBuildDate>Mon, 06 Feb 2012 09:27:36 +0900</lastBuildDate>
        <generator>FeedCreator 1.7.2-ppt DokuWiki</generator>
        <image>
            <url>http://wiki.dgoon.net/lib/tpl/default/images/favicon.ico</url>
            <title>D-Goon's Doc</title>
            <link>http://wiki.dgoon.net/</link>
        </image>
        <item>
            <title>private:책목록 - [비문학] </title>
            <link>http://wiki.dgoon.net/doku.php?id=private:%EC%B1%85%EB%AA%A9%EB%A1%9D</link>
            <description>
&lt;h2 class=&quot;sectionedit1&quot;&gt;&lt;a name=&quot;디군의_책_리스트&quot; id=&quot;디군의_책_리스트&quot;&gt;디군의 책 리스트&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
별도의 관리 툴을 만들기 전까지, 일단 목록이라도 있어야 할 것 같아서 정리.
전공서적의 경우 번역서는 별도 표시, 그 외의 경우는 원서를 별도 표기. 둘 다 있는 경우는 둘다 써서 구분. 원서는 가능한 경우 제목도 해당 언어로.
&lt;/p&gt;

&lt;p&gt;
- 상자에서 안꺼낸 책들 어쩔꺼야 ㅠㅠ
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT1 SECTION &quot;디군의 책 리스트&quot; [1-392] --&gt;
&lt;h3 class=&quot;sectionedit2&quot;&gt;&lt;a name=&quot;전공&quot; id=&quot;전공&quot;&gt;전공&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; TAOCP Vol.1&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; TAOCP Vol.2&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; TAOCP Vol.3&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; TAOCP Fascicles 0, 1, 2, 3, 4 of Vol.4&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Concrete mathematics&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; SICP&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Beyond the C++ Standard Library &lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; C++ Standard library&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Data Mining&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Artificial Intelligence&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 유닉스 시스템 프로그래밍 SVR 4(번역)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 실용주의 프로그래머&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 이펙티브 STL&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Pro Android 2 (EBOOK)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Agile Web Development with Rails (EBOOK)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Programming Erlang (EBOOK)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Programming in Clojure (EBOOK)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 프로토타이핑&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 프로그램 디자인 어떻게 할 것인가&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT2 SECTION &quot;전공&quot; [393-960] --&gt;
&lt;h3 class=&quot;sectionedit3&quot;&gt;&lt;a name=&quot;cs_관련_비전공&quot; id=&quot;cs_관련_비전공&quot;&gt;CS 관련(?) 비전공&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 사랑하지 않으면 떠나라&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 고약한 문제, 합당한 해결&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; G.E.B. (원서)&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT3 SECTION &quot;CS 관련(?) 비전공&quot; [961-1090] --&gt;
&lt;h3 class=&quot;sectionedit4&quot;&gt;&lt;a name=&quot;문학&quot; id=&quot;문학&quot;&gt;문학&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 파우스트 1/2&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 기형도 전집&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 이상한 나라의 앨리스&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 거울 나라의 앨리스&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 時をかける少女(시간을 달리는 소녀) (원서)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 꿈꾸는 책들의 도시 1/2&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 폐도 1/2/3&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 아서 클라크 단편 전집&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 미인계&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 천개의 찬란한 태양&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 눈먼 자들의 도시&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 한 권으로 읽는 잃어버린 시간을 찾아서&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 차라투스트라는 이렇게 말했다&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 전도서에 바치는 장미&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 키리냐가&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 지식의 역사&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 지식의 단련법&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 성의 패러독스&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT4 SECTION &quot;문학&quot; [1091-1662] --&gt;
&lt;h3 class=&quot;sectionedit5&quot;&gt;&lt;a name=&quot;비문학&quot; id=&quot;비문학&quot;&gt;비문학&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 전략의 탄생&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 한용운의 채근담 강의&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Lewis Carol and Alice&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 듀이 (clover3leaf → 디군 → 하프리)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; The Secret&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 이기주의를 위한 변명&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 교과서가 죽인 책들&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 여행의 기술&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://hyeranh.net/1628&quot; class=&quot;urlextern&quot; title=&quot;http://hyeranh.net/1628&quot;  rel=&quot;nofollow&quot;&gt;함께 읽으면 즐겁습니다&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 러셀의 행복론&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 나는 왜 기독교인이 아닌가&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 게으름에 대한 찬양&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 파인만의 또 다른 물리학 강의&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 워킹 푸어, 빈곤의 경계에서 말하다&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 정의란 무엇인가&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 최초의 신화 길가메쉬 서사시&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 소크라테스의 변명&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 공부는 내 인생에 대한 예의다&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 홀가분&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 지식의 단련법&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT5 SECTION &quot;비문학&quot; [1663-2354] --&gt;
&lt;h3 class=&quot;sectionedit6&quot;&gt;&lt;a name=&quot;nt류&quot; id=&quot;nt류&quot;&gt;NT류&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 공의 경계 상/중/하 (원서)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 공의 경계 상/하 (번역)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 하루카 천공의 야마타이국&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 하루카 염천의 야마타이국 (완결)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 잘린머리 사이클&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 목조르는 로맨티스트&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 목매다는 하이스쿨&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 사이코로지컬 상/하&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT6 SECTION &quot;NT류&quot; [2355-2655] --&gt;
&lt;h3 class=&quot;sectionedit7&quot;&gt;&lt;a name=&quot;만화&quot; id=&quot;만화&quot;&gt;만화&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 3月のライオン 1~5 (원서)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 3월의 라이온 1~5 (번역)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 카페알파 전권(1~14) (번역)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 허니와 클로버 전권(0~10) (번역)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 마이걸 1~3 (번역)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Nabi 1~8&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Nabi 단편집&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Fly&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 맑은 봄빛 사랑 이야기 - 모모네&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 별의 목소리&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 버스 달리다&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 멸망한 짐승들의 바다&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 블루홀 1/2&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 문로스트 1/2&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 소용돌디 1~3&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 예스터데이를 노래하며 1~7 (번역)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Tom Sawyer (번역)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 신부 이야기 1,2 (번역)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 치키타 구구 1~8 (번역)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 문화 콘텐츠의 이해&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 마니마니&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 붉은 딸기 흰 딸기&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 진격의 거인 1,2,3,4 (번역)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 토끼 드롭스 1~6&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 스트로보라이트&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT7 SECTION &quot;만화&quot; [2656-3387] --&gt;
&lt;h3 class=&quot;sectionedit8&quot;&gt;&lt;a name=&quot;예술&quot; id=&quot;예술&quot;&gt;예술&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 강병규 지리산 사진집&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 연필 하나로 시작하는 스케치 연습장&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Life &amp;amp; Nature - 내셔널 지오그래픽전 대도록&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT8 SECTION &quot;예술&quot; [3388-] --&gt;</description>
            <author>dgoon</author>
        <category>private</category>
            <pubDate>Sat, 29 Oct 2011 14:32:58 +0900</pubDate>
        </item>
        <item>
            <title>sicp:exercise_ch5.4 - [Ex 5.30] </title>
            <link>http://wiki.dgoon.net/doku.php?id=sicp:exercise_ch5.4</link>
            <description>
&lt;h1 class=&quot;sectionedit9&quot;&gt;&lt;a name=&quot;sicp&quot; id=&quot;sicp&quot;&gt;SICP&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT9 SECTION &quot;SICP&quot; [1-20] --&gt;
&lt;h2 class=&quot;sectionedit10&quot;&gt;&lt;a name=&quot;exercises_on_chapter_54&quot; id=&quot;exercises_on_chapter_54&quot;&gt;Exercises on Chapter 5.4&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT10 SECTION &quot;Exercises on Chapter 5.4&quot; [21-59] --&gt;
&lt;h3 class=&quot;sectionedit11&quot;&gt;&lt;a name=&quot;ex_523&quot; id=&quot;ex_523&quot;&gt;Ex 5.23&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Extend the evaluator to handle derived expressions such as &lt;em&gt;cond&lt;/em&gt;, &lt;em&gt;let&lt;/em&gt;, and so on (seciton 4.1.2). You may “cheat” and assume that the syntax transformers such as &lt;em&gt;cond→if&lt;/em&gt; are available as machine operations.
&lt;/p&gt;

&lt;p&gt;
&lt;em&gt;cond?&lt;/em&gt;, &lt;em&gt;cond→if&lt;/em&gt; 가 이미 있다는 가정을 하면 아주 쉽다. &lt;em&gt;eceval-operations&lt;/em&gt; 에 
&lt;/p&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
   ;; Exercise 5.23
   (list &amp;#039;cond? cond?)
   (list &amp;#039;cond-&amp;gt;if cond-&amp;gt;if)
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
이렇게 두 줄을 추가해준다. &lt;em&gt;cond?&lt;/em&gt;, &lt;em&gt;cond→if&lt;/em&gt; 의 구현은 4장에서 빌려온다. 그리고 &lt;em&gt;eval-dispatch&lt;/em&gt; 에서,
&lt;/p&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
  ;; Exercise 5.23
  (test (op cond?) (reg exp))
  (branch (label ev-cond))
  ;; ----
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
이렇게 해당 operation을 잡아서 점프를 해 주고, 저것을 받는 ev-cond 를 만들면 된다. ev-cond의 구현은 &lt;em&gt;cond→if&lt;/em&gt; 가 된다. &lt;em&gt;exp&lt;/em&gt;에 변환된 &lt;strong&gt;if&lt;/strong&gt; 문을 넣은 다음, 이걸 처리하기 위해 &lt;strong&gt;ev-if&lt;/strong&gt; 로 가면 끝.
&lt;/p&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
ev-cond
  (assign exp (op cond-&amp;gt;if) (reg exp))
  (goto (label ev-if))
&lt;/pre&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://study-sicp.googlecode.com/svn/trunk/chapter-05/ex5.23-dgoon.scm&quot; class=&quot;urlextern&quot; title=&quot;http://study-sicp.googlecode.com/svn/trunk/chapter-05/ex5.23-dgoon.scm&quot;  rel=&quot;nofollow&quot;&gt;http://study-sicp.googlecode.com/svn/trunk/chapter-05/ex5.23-dgoon.scm&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT11 SECTION &quot;Ex 5.23&quot; [60-1150] --&gt;
&lt;h3 class=&quot;sectionedit12&quot;&gt;&lt;a name=&quot;ex_524&quot; id=&quot;ex_524&quot;&gt;Ex 5.24&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Implement &lt;em&gt;cond&lt;/em&gt; as a new basic special form without reducing it to &lt;em&gt;if&lt;/em&gt;. You will have to construct a loop that tests the predicates of successive &lt;em&gt;cond&lt;/em&gt; clauses until you find one that is true, and then use &lt;em&gt;ev-sequence&lt;/em&gt; to evaluate the actions of the clause.
&lt;/p&gt;

&lt;p&gt;
위 5.23 의 &lt;em&gt;ev-cond&lt;/em&gt; 부분을 &lt;em&gt;cond→if&lt;/em&gt; 대신 machine language 로 직접 구현하라는 문제이다. 디버깅이 어려워서 꽤 오래 걸렸다. 풀이 후반에 추가한 &lt;em&gt;print&lt;/em&gt; 함수가 아주 큰 도움이 되었다. 일단 아래와 같이 cond 관련 함수들과 &lt;em&gt;print&lt;/em&gt; 를 함께 추가하자. &lt;em&gt;print&lt;/em&gt; 는,
&lt;/p&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
(perform (op print) (reg exp))
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
이런 식으로 레지스터의 내용을 찍어볼 수 있고, 없으면 디버깅이 거의 불가하다. … -_-a
&lt;/p&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
(define print (lambda (x) (display x)(newline)))
(define eceval-operations
  (list
    ...
    ...
       ;; Exercise 5.23
   (list &amp;#039;cond? cond?)
   ;(list &amp;#039;cond-&amp;gt;if cond-&amp;gt;if) ;; Exercise 5.24 doesn&amp;#039;t use it.
   (list &amp;#039;cond-clauses cond-clauses)
   (list &amp;#039;cond-predicate cond-predicate)
   (list &amp;#039;cond-actions cond-actions)
   ;; for debug
   (list &amp;#039;print print)
   ))
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;em&gt;eval-dispatch&lt;/em&gt; 에서는 그냥 &lt;em&gt;ev-cond&lt;/em&gt; 로 점프한다.
&lt;/p&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
  ;; Exercise 5.23, 5.24
  (test (op cond?) (reg exp))
  (branch (label ev-cond))
  ;; ----
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
아래는 &lt;em&gt;ev-cond&lt;/em&gt; 로부터 시작되는 실제 구현부이다. 귀찮아서 &lt;strong&gt;else&lt;/strong&gt; 처리는 하지 않았다. 맞는 조건이 하나도 없거나 else 를 만나면 에러가 난다.
&lt;/p&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
;; Exercise 5.24
ev-cond
  (assign exp (op cond-clauses) (reg exp)) ; now exp has clauses
  (save continue)
ev-cond-body
  (save exp)
  (save env)
  (assign continue (label ev-cond-loop))
  (assign unev (op first-exp) (reg exp)) ; unev is now A CLAUSE
  (assign exp (op cond-predicate) (reg unev)) ; exp is now A PREDICATE of A CLAUSE

  ;; (perform (op print) (reg exp)) ;; debug msg

  (goto (label eval-dispatch))
ev-cond-loop
  (restore env)
  (restore exp)
  (test (op true?) (reg val))
  (branch (label ev-cond-out))
  (assign exp (op rest-exps) (reg exp))
  (goto (label ev-cond-body))

ev-cond-out
  ;(restore continue) ;; becasue we&amp;#039;ll directly jump into ev-sequence, not ev-begin
  ;(perform (op print) (reg exp)) ;; debug msg

  (assign unev (op first-exp) (reg exp)) ; unev is A CLAUSE which will be returned
  (assign exp (op cond-actions) (reg unev)) ; exp is ACTIONs!

  ;(perform (op print) (reg exp)) ;; debug msg

  (goto (label ev-sequence))
;; -----
&lt;/pre&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://study-sicp.googlecode.com/svn/trunk/chapter-05/ex5.24-dgoon.scm&quot; class=&quot;urlextern&quot; title=&quot;http://study-sicp.googlecode.com/svn/trunk/chapter-05/ex5.24-dgoon.scm&quot;  rel=&quot;nofollow&quot;&gt;http://study-sicp.googlecode.com/svn/trunk/chapter-05/ex5.24-dgoon.scm&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT12 SECTION &quot;Ex 5.24&quot; [1151-3759] --&gt;
&lt;h3 class=&quot;sectionedit13&quot;&gt;&lt;a name=&quot;ex_525&quot; id=&quot;ex_525&quot;&gt;Ex 5.25&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Modify the evaluator so that it uses normal-order evaluation, based on the lazy evaluator of section 4.2.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT13 SECTION &quot;Ex 5.25&quot; [3760-3884] --&gt;
&lt;h3 class=&quot;sectionedit14&quot;&gt;&lt;a name=&quot;ex_526&quot; id=&quot;ex_526&quot;&gt;Ex 5.26&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
 Use the monitored stack to explore the tail-recursive property of the evaluator (section 5.4.2). Start the evaluator and define the iterative &lt;em&gt;factorial&lt;/em&gt; procedure from section 1.2.1:
&lt;/p&gt;

&lt;p&gt;
(define (factorial n)
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;(define (iter product counter)
  (if (&amp;gt; counter n)
      product
      (iter (* counter product)
            (+ counter 1))))
(iter 1 1))&lt;/pre&gt;

&lt;p&gt;
Run the procedure with some small values of &lt;em&gt;n&lt;/em&gt;. Record the maximum stack depth and the number of pushes required to compute &lt;em&gt;n&lt;/em&gt;! for each of these values.
&lt;/p&gt;

&lt;p&gt;
a. You will find that the maximum depth required to evaluate n! is independent of &lt;em&gt;n&lt;/em&gt;. What is that depth?
&lt;/p&gt;

&lt;p&gt;
앞에 나왔던 monitored stack을 구현하고 위 코드로 1부터 10까지에 대해서 답을 구해 보았다. print-statistics 의 결과만 모아보면 아래와 같다.
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
(total-pushes = 3 maximum-depth = 3)
(total-pushes = 64 maximum-depth = 10)
(total-pushes = 99 maximum-depth = 10)
(total-pushes = 134 maximum-depth = 10)
(total-pushes = 169 maximum-depth = 10)
(total-pushes = 204 maximum-depth = 10)
(total-pushes = 239 maximum-depth = 10)
(total-pushes = 274 maximum-depth = 10)
(total-pushes = 309 maximum-depth = 10)
(total-pushes = 344 maximum-depth = 10)
(total-pushes = 379 maximum-depth = 10)
&lt;/pre&gt;
처음 한 번은 &lt;em&gt;factorial&lt;/em&gt; 함수를 정의할 때이므로 제외하고을 나머지의 스택 깊이는 10으로 일정하다.
&lt;/p&gt;

&lt;p&gt;
b. Determine from your data a formula in terms of n for the total number of push operations used in evaluating &lt;em&gt;n&lt;/em&gt;! for any &lt;em&gt;n&lt;/em&gt; &amp;gt; 1. Note that the number of operations used is a linear function of &lt;em&gt;n&lt;/em&gt; and is thus determined by two constants.
&lt;/p&gt;
&lt;div class=&quot;table sectionedit15&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; n &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; 2 &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; 3 &lt;/td&gt;&lt;td class=&quot;col3&quot;&gt; 4 &lt;/td&gt;&lt;td class=&quot;col4&quot;&gt; 5 &lt;/td&gt;&lt;td class=&quot;col5&quot;&gt; 6 &lt;/td&gt;&lt;td class=&quot;col6&quot;&gt; 7 &lt;/td&gt;&lt;td class=&quot;col7&quot;&gt; 8 &lt;/td&gt;&lt;td class=&quot;col8&quot;&gt; 9 &lt;/td&gt;&lt;td class=&quot;col9&quot;&gt; 10 &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; # of pushes &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; 99 &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; 134 &lt;/td&gt;&lt;td class=&quot;col3&quot;&gt; 169 &lt;/td&gt;&lt;td class=&quot;col4&quot;&gt; 204 &lt;/td&gt;&lt;td class=&quot;col5&quot;&gt; 239 &lt;/td&gt;&lt;td class=&quot;col6&quot;&gt; 274 &lt;/td&gt;&lt;td class=&quot;col7&quot;&gt; 309 &lt;/td&gt;&lt;td class=&quot;col8&quot;&gt; 344 &lt;/td&gt;&lt;td class=&quot;col9&quot;&gt; 379 &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT15 TABLE [5550-5661] --&gt;
&lt;p&gt;
&lt;em&gt;n&lt;/em&gt;이 1 증가할 때마다 # of pushes 는 35씩 일정하게 증가하고 있다는 것을 알 수 있다. 1차 함수이므로, 1차식을 만들어 표현하면 아래와 같다.
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;# of pushes = 35n + 29&lt;/strong&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT14 SECTION &quot;Ex 5.26&quot; [3885-5876] --&gt;
&lt;h3 class=&quot;sectionedit16&quot;&gt;&lt;a name=&quot;ex_527&quot; id=&quot;ex_527&quot;&gt;Ex 5.27&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
For comparison with exercise 5.26, explore the behavior of the following procedure for computing factorials recursively:
&lt;/p&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
(define (factorial n)
  (if (= n 1)
      1
      (* (factorial (- n 1)) n)))
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
By running this procedure with the monitored stack, determine, as a function of &lt;em&gt;n&lt;/em&gt;, the maximum depth of the stack and the total number of pushes used in evaluating &lt;em&gt;n&lt;/em&gt;! for &lt;em&gt;n&lt;/em&gt; &amp;gt; 1. (Again, these functions will be linear.) Summarize your experiments by filling in the following table with the appropriate expressions in terms of &lt;em&gt;n&lt;/em&gt;:
&lt;/p&gt;
&lt;div class=&quot;table sectionedit17&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Maximum depth	&lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; Number of pushes &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; Recursive factorial &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; 5n+3 &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; 32n-16 &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; Iterative factorial &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; 10 &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; 35n+29 &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT17 TABLE [6456-6572] --&gt;
&lt;p&gt;
The maximum depth is a measure of the amount of space used by the evaluator in carrying out the computation, and the number of pushes correlates well with the time required.
&lt;/p&gt;

&lt;p&gt;
일단 위와 같이 재귀적인 &lt;em&gt;factorial&lt;/em&gt; 에 대해서도 1부터 10까지의 &lt;em&gt;n&lt;/em&gt; 을 넣어 &lt;em&gt;print-statistics&lt;/em&gt; 의 결과를 뽑아 보았다.
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
(total-pushes = 3 maximum-depth = 3)
(total-pushes = 16 maximum-depth = 8)
(total-pushes = 48 maximum-depth = 13)
(total-pushes = 80 maximum-depth = 18)
(total-pushes = 112 maximum-depth = 23)
(total-pushes = 144 maximum-depth = 28)
(total-pushes = 176 maximum-depth = 33)
(total-pushes = 208 maximum-depth = 38)
(total-pushes = 240 maximum-depth = 43)
(total-pushes = 272 maximum-depth = 48)
(total-pushes = 304 maximum-depth = 53)
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
연습문제 5.26과는 다르게 maximum-depth가 계속 증가하는 양상을 보인다. total-pushes는 약간 작은 것 같지만, 그래도 1차 함수처럼 보인다. 손으로 약간 정리해보면,
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;max-depth = 5n+3&lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;# of pushes = 32n-16&lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
로 정리할 수 있다. 이를 가지고 위 표를 채워 넣었다. Recursive factorial 의 경우 공간/시간복잡도 모두 O(n) 이다.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT16 SECTION &quot;Ex 5.27&quot; [5877-7757] --&gt;
&lt;h3 class=&quot;sectionedit18&quot;&gt;&lt;a name=&quot;ex_528&quot; id=&quot;ex_528&quot;&gt;Ex 5.28&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Modify the definition of the evaluator by changing eval-sequence as described in section 5.4.2 so that the evaluator is no longer tail-recursive. Rerun your experiments from exercises 5.26 and 5.27 to demonstrate that both versions of the factorial procedure now require space that grows linearly with their input.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT18 SECTION &quot;Ex 5.28&quot; [7758-8091] --&gt;
&lt;h3 class=&quot;sectionedit19&quot;&gt;&lt;a name=&quot;ex_529&quot; id=&quot;ex_529&quot;&gt;Ex 5.29&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Monitor the stack operations in the tree-recursive Fibonacci computation:
&lt;/p&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
(define (fib n)
  (if (&amp;lt; n 2)
      n
      (+ (fib (- n 1)) (fib (- n 2)))))
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
a. Give a formula in terms of &lt;em&gt;n&lt;/em&gt; for the maximum depth of the stack required to compute &lt;em&gt;Fib(n)&lt;/em&gt; for &lt;em&gt;n&lt;/em&gt; &amp;gt;= 2. Hint: In section 1.2.2 we argued that the space used by this process grows linearly with &lt;em&gt;n&lt;/em&gt;.
&lt;/p&gt;

&lt;p&gt;
n의 값을 1부터 12까지 증가시켜가며 print-statistics의 출력을 모아보았다. 역시 첫번째 줄은 함수 정의에서 나온 것으로 두번째 줄부터 시작이다. 
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
(total-pushes = 3 maximum-depth = 3)
(total-pushes = 16 maximum-depth = 8)
(total-pushes = 72 maximum-depth = 13)
(total-pushes = 128 maximum-depth = 18)
(total-pushes = 240 maximum-depth = 23)
(total-pushes = 408 maximum-depth = 28)
(total-pushes = 688 maximum-depth = 33)
(total-pushes = 1136 maximum-depth = 38)
(total-pushes = 1864 maximum-depth = 43)
(total-pushes = 3040 maximum-depth = 48)
(total-pushes = 4944 maximum-depth = 53)
(total-pushes = 8024 maximum-depth = 58)
(total-pushes = 13008 maximum-depth = 63)
&lt;/pre&gt;
maximum-depth는 손쉽게 5씩 증가하는 1차 함수라는 것을 알 수 있다. 
&lt;/p&gt;

&lt;p&gt;
b. Give a formula for the total number of pushes used to compute &lt;em&gt;Fib(n)&lt;/em&gt; for &lt;em&gt;n&lt;/em&gt; &amp;gt;= 2. You should find that the number of pushes (which correlates well with the time used) grows exponentially with &lt;em&gt;n&lt;/em&gt;. Hint: Let &lt;em&gt;S(n)&lt;/em&gt; be the number of pushes used in computing &lt;em&gt;Fib(n)&lt;/em&gt;. You should be able to argue that there is a formula that expresses &lt;em&gt;S(n)&lt;/em&gt; in terms of &lt;em&gt;S(n - 1), S(n - 2)&lt;/em&gt;, and some fixed ``overhead&amp;#039;&amp;#039; constant &lt;em&gt;k&lt;/em&gt; that is independent of &lt;em&gt;n&lt;/em&gt;. Give the formula, and say what &lt;em&gt;k&lt;/em&gt; is. Then show that &lt;em&gt;S(n)&lt;/em&gt; can be expressed as a &lt;em&gt;Fib(n + 1) + b&lt;/em&gt; and give the values of &lt;em&gt;a&lt;/em&gt; and &lt;em&gt;b&lt;/em&gt;.
&lt;/p&gt;

&lt;p&gt;
힌트에서 주어진대로 fib(n) 을 구하는데 필요한 # of stack pushes 를 S(n) 이라고 하자. fib(n) = fib(n-1) + fib(n-2) 이므로, 당연히 S(n)을 구하는 데에는 S(n-1)과 S(n-2)가 일단 더해지게 된다.
&lt;/p&gt;
&lt;div class=&quot;table sectionedit20&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; n &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; 1 &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; 2 &lt;/td&gt;&lt;td class=&quot;col3&quot;&gt; 3 &lt;/td&gt;&lt;td class=&quot;col4&quot;&gt; 4 &lt;/td&gt;&lt;td class=&quot;col5&quot;&gt; 5 &lt;/td&gt;&lt;td class=&quot;col6&quot;&gt; 6 &lt;/td&gt;&lt;td class=&quot;col7&quot;&gt; 7 &lt;/td&gt;&lt;td class=&quot;col8&quot;&gt; 8 &lt;/td&gt;&lt;td class=&quot;col9&quot;&gt; 9 &lt;/td&gt;&lt;td class=&quot;col10&quot;&gt; 10 &lt;/td&gt;&lt;td class=&quot;col11&quot;&gt; 11 &lt;/td&gt;&lt;td class=&quot;col12&quot;&gt; 12 &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; S(n) &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; 16 &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; 72 &lt;/td&gt;&lt;td class=&quot;col3&quot;&gt; 128 &lt;/td&gt;&lt;td class=&quot;col4&quot;&gt; 240 &lt;/td&gt;&lt;td class=&quot;col5&quot;&gt; 408 &lt;/td&gt;&lt;td class=&quot;col6&quot;&gt; 688 &lt;/td&gt;&lt;td class=&quot;col7&quot;&gt; 1136 &lt;/td&gt;&lt;td class=&quot;col8&quot;&gt; 1864 &lt;/td&gt;&lt;td class=&quot;col9&quot;&gt; 3040 &lt;/td&gt;&lt;td class=&quot;col10&quot;&gt; 4944 &lt;/td&gt;&lt;td class=&quot;col11&quot;&gt; 8024 &lt;/td&gt;&lt;td class=&quot;col12&quot;&gt; 13008 &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; S(n-1)+S(n-2) &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; &lt;/td&gt;&lt;td class=&quot;col3&quot;&gt; 88 &lt;/td&gt;&lt;td class=&quot;col4&quot;&gt; 200 &lt;/td&gt;&lt;td class=&quot;col5&quot;&gt; 368 &lt;/td&gt;&lt;td class=&quot;col6&quot;&gt; 648 &lt;/td&gt;&lt;td class=&quot;col7&quot;&gt; 1096 &lt;/td&gt;&lt;td class=&quot;col8&quot;&gt; 1824 &lt;/td&gt;&lt;td class=&quot;col9&quot;&gt; 3000 &lt;/td&gt;&lt;td class=&quot;col10&quot;&gt; 4904 &lt;/td&gt;&lt;td class=&quot;col11&quot;&gt; 7984 &lt;/td&gt;&lt;td class=&quot;col12&quot;&gt; 12968 &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT20 TABLE [10157-10387] --&gt;
&lt;p&gt;
이 표를 보면, 거의 자명하게
&lt;/p&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
S(1) = 16
S(2) = 72
S(n) = S(n-1) + S(n-2) + 40 if n&amp;gt;=2
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
라는 점화식을 만들 수 있다. &lt;em&gt;fib(n)&lt;/em&gt; 을 계산하는데 필요한 스택의 push 횟수 역시 피보나치 수를 따라가는 아름다움!
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT19 SECTION &quot;Ex 5.29&quot; [8092-10657] --&gt;
&lt;h3 class=&quot;sectionedit21&quot;&gt;&lt;a name=&quot;ex_530&quot; id=&quot;ex_530&quot;&gt;Ex 5.30&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Our evaluator currently catches and signals only two kinds of errors – unknown expression types and unknown procedure types. Other errors will take us out of the evaluator read-eval-print loop. When we run the evaluator using the register-machine simulator, these errors are caught by the underlying Scheme system. This is analogous to the computer crashing when a user program makes an error.&lt;a href=&quot;http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-34.html#call_footnote_Temp_793&quot; class=&quot;urlextern&quot; title=&quot;http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-34.html#call_footnote_Temp_793&quot;  rel=&quot;nofollow&quot;&gt;(footnote)&lt;/a&gt; It is a large project to make a real error system work, but it is well worth the effort to understand what is involved here.
&lt;/p&gt;

&lt;p&gt;
a. Errors that occur in the evaluation process, such as an attempt to access an unbound variable, could be caught by changing the lookup operation to make it return a distinguished condition code, which cannot be a possible value of any user variable. The evaluator can test for this condition code and then do what is necessary to go to signal-error. Find all of the places in the evaluator where such a change is necessary and fix them. &lt;strong&gt;This is lots of work.&lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
b. Much worse is the problem of handling errors that are signaled by applying primitive procedures, such as an attempt to divide by zero or an attempt to extract the car of a symbol. In a professionally written high-quality system, each primitive application is checked for safety as part of the primitive. For example, every call to car could first check that the argument is a pair. If the argument is not a pair, the application would return a distinguished condition code to the evaluator, which would then report the failure. We could arrange for this in our register-machine simulator by making each primitive procedure check for applicability and returning an appropriate distinguished condition code on failure. Then the primitive-apply code in the evaluator can check for the condition code and go to signal-error if necessary. Build this structure and make it work. &lt;strong&gt;This is a major project.&lt;/strong&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT21 SECTION &quot;Ex 5.30&quot; [10658-] --&gt;</description>
            <author>dgoon</author>
        <category>sicp</category>
            <pubDate>Tue, 04 Oct 2011 21:07:19 +0900</pubDate>
        </item>
        <item>
            <title>ssl:인증서_만들기 - [SSL] </title>
            <link>http://wiki.dgoon.net/doku.php?id=ssl:%EC%9D%B8%EC%A6%9D%EC%84%9C_%EB%A7%8C%EB%93%A4%EA%B8%B0</link>
            <description>
&lt;h1 class=&quot;sectionedit22&quot;&gt;&lt;a name=&quot;ssl&quot; id=&quot;ssl&quot;&gt;SSL&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
키 생성, 인증서, 어렵게 들리지만 시스템에 설치된 openssl로 그냥 생성할 수 있다. 별 것 없다. &lt;a href=&quot;http://www.openssl.org/docs/HOWTO/&quot; class=&quot;urlextern&quot; title=&quot;http://www.openssl.org/docs/HOWTO/&quot;  rel=&quot;nofollow&quot;&gt;http://www.openssl.org/docs/HOWTO/&lt;/a&gt; 여기 문서를 참고해서 정리한다. 거의 번역&amp;amp;요약 수준이다.
&lt;/p&gt;

&lt;p&gt;
인증서는 공개 키 보안 시스템과 밀접하게 관련된다. 아마도 사전 지식이 있겠지만 공개 키 기반의 보안 시스템에서는 &lt;strong&gt;공개 키(Public key)&lt;/strong&gt;와 &lt;strong&gt;개인 키(Private key)&lt;/strong&gt;, 이렇게 두 개의 키가 쌍으로 존재한다. 인증서는 이 중에서 &lt;strong&gt;개인 키&lt;/strong&gt; 와 얽히게 된다.
&lt;/p&gt;

&lt;p&gt;
인증서는 서명에 사용된 개인 키가 &lt;em&gt;크고 훌륭한 믿을 만한 녀석들&lt;/em&gt; 의 것이라면 인증서도 믿을만 하다고 볼 수 있다. 이렇게 크고 훌륭한 인증서에 서명을 해주는 기관을 Certificate Authority(CA) 라고 하며, 이 기관들 순전히 인증서를 검토하고 괜찮아 보이면 자기들 개인 키로 서명을 해주고 돈을 받는 장사를 한다. 개인적인 용도나 테스트용도라면 이런 비싼 기관들을 통하지 않고 그냥 &lt;em&gt;믿음직한 나&lt;/em&gt; 가 바로 서명을 해서 쓸 수도 있다. 물론, 다른 사람이 볼 때에도 믿음직한지에 대한 문제는 알아서 해결해야 한다.
&lt;/p&gt;

&lt;p&gt;
돈을 내고 공인 기관으로부터 인증서를 받으려면, &lt;em&gt;인증서 요청&lt;/em&gt; 을 생성해서 CA 에게 보내야 한다. 자기가 직접 서명한 &lt;em&gt;인증서&lt;/em&gt; 는 바로 생성할 수 있다. 아래의 커맨드는 모두 Debian squeeze/Ubuntu 10.04(LTS) 에서 openssl 패키지를 설치하면 가능하게 된다.
&lt;/p&gt;

&lt;p&gt;
공인 인증기관으로부터 서명을 받는 경우라면, 내가 해본 적이 없으므로 더 찾아보고 프로세스를 알아내어 나에게 알려주면 좋겠다.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT22 SECTION &quot;SSL&quot; [1-1789] --&gt;
&lt;h2 class=&quot;sectionedit23&quot;&gt;&lt;a name=&quot;generate_certificate_request&quot; id=&quot;generate_certificate_request&quot;&gt;Generate certificate request&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
openssl req -new -key private.pem -out cert.csr
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
그리고 몇 개의 추가 정보를 입력하면 된다. 인증서 요청과 연결될 나의 개인 키는 private.pem, 그리고 서명해주세요~ 라고 보낼 인증서 요청 파일이 cert.csr 이다.
&lt;/p&gt;

&lt;p&gt;
검색해보면 쉽게 찾을 수 있지만, 귀찮은 사람을 위해 간단하게 확장자를 설명하면,
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; PEM: Privacy Enhanced Mail - 인증서 내용을 base64 로 인코딩한 것이다. 시작과 끝 줄이 각각 —–BEGIN CERTIFICATE REQUEST—–, —–END CERTIFICATE REQUEST—– 로 표시된다&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; CSR: Certificate Signing Request 의 약자&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
인증서 포맷으로는 PEM 이외에도 DER, CER 등이 있다. 궁금하면 찾아보면 된다. 혹 다른 포맷의 키가 필요한 경우 openssl 이 변환도 해 준다. 필요하면 검색해본다.
어? 그런데 난 아직 개인키가 없는데 … … 라는 사람을 위해 잠시 키 생성을 돌아보자.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT23 SECTION &quot;Generate certificate request&quot; [1790-2799] --&gt;
&lt;h2 class=&quot;sectionedit24&quot;&gt;&lt;a name=&quot;generate_private_key&quot; id=&quot;generate_private_key&quot;&gt;Generate private key&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
개인 키는 두 가지가 있다. RSA, DSA 중 하나를 용도에 맞게 고른다. … 그냥 RSA로 하기를 추천한다. 간단하게 RSA 키는 인증/암호화 둘 모두 할 수 있고, DSA 키는 인증-즉, 서명-에만 사용한다고 참고한 HOWTO 에 쓰여 있었다.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT24 SECTION &quot;Generate private key&quot; [2800-3120] --&gt;
&lt;h3 class=&quot;sectionedit25&quot;&gt;&lt;a name=&quot;rsa_key&quot; id=&quot;rsa_key&quot;&gt;RSA Key&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
openssl genrsa
&lt;/pre&gt;
이렇게 실행하면 화면으로 512 bit RSA 개인 키를 PEM 형식으로 내보낸다. 
&lt;/p&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
openssl genrsa 1024 -out private.pem
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
이렇게 실행하면 1024 bit RSA key를 private.pem 이라는 파일에 쓴다. 위 인증서 생성을 위한건 이걸로 충분하다.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT25 SECTION &quot;RSA Key&quot; [3121-3458] --&gt;
&lt;h3 class=&quot;sectionedit26&quot;&gt;&lt;a name=&quot;dsa_key&quot; id=&quot;dsa_key&quot;&gt;DSA Key&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
opessl gendsa 만으로는 생성이 되지 않는다. 어떤 파라미터 파일을 필요로 한다는데, 무엇인지 잘은 모르지만 DSA를 위한 파라미터 파일 생성도 openssl 로 할 수 있다.
&lt;/p&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
openssl dsaparam -out dsaparam.pem -genkey 1024
openssl gendsa -out dsa_private.pem dsaparam.pem
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
이렇게 하면 된다. DSA 키로도 인증서는 생성할 수 있다.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT26 SECTION &quot;DSA Key&quot; [3459-3879] --&gt;
&lt;h2 class=&quot;sectionedit27&quot;&gt;&lt;a name=&quot;generate_self-signed_certificate&quot; id=&quot;generate_self-signed_certificate&quot;&gt;Generate self-signed certificate&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
뭐 CA까지 갈 게 있나. 테스트 혹은 개인적인 용도로 쓸 인증서라면 자기가 서명해도 된다. 위의 인증서 요청 생성 명령에서 -x509(포맷 지정)과 -days 옵션을(만료기간) 추가하면 된다.
&lt;/p&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
openssl req -new -x509 -key private.pem -out cert.pem -days 1095
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
공인인증기관에 갈 때는 이렇게 하면 안되겠지만, 물어보는거 일일일 답하거나 엔터 누르기 귀찮으면 뒤에 &lt;strong&gt;-batch&lt;/strong&gt; 를 붙여넣으면 귀찮게 물어보지 않는다. 내가 서명할 거니까 이렇게 스루해도 된다.
이 경우 위의 CSR 과는 달리 —–BEGIN CERTIFICATE—–, —–END CERTIFICATE—– 이렇게 쓰여 있다. REQUEST 가 사라져 있지!
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT27 SECTION &quot;Generate self-signed certificate&quot; [3880-4658] --&gt;
&lt;h2 class=&quot;sectionedit28&quot;&gt;&lt;a name=&quot;verify&quot; id=&quot;verify&quot;&gt;Verify&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
이렇게 만든 키/인증서들의 내용을 보는 명령은 아래와 같다. &lt;del&gt;하지만 봐도 모른다.&lt;/del&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
openssl x509 -noout -text -in cert.pem
openssl rsa -noout -text -in private.pem
openssl dsa -noout -text -in dsa_private.pem
&lt;/pre&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT28 SECTION &quot;Verify&quot; [4659-] --&gt;</description>
            <author>dgoon</author>
        <category>ssl</category>
            <pubDate>Fri, 12 Aug 2011 18:14:14 +0900</pubDate>
        </item>
        <item>
            <title>python:sampleechoserv - 새로 만듦</title>
            <link>http://wiki.dgoon.net/doku.php?id=python:sampleechoserv</link>
            <description>
&lt;h1 class=&quot;sectionedit29&quot;&gt;&lt;a name=&quot;ssl&quot; id=&quot;ssl&quot;&gt;SSL&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
SSL로 간단하게 메시지를 주고 받는 샘플 코드를 만들어둔다. 이를 위해서는 개인 키(private.pem)와 인증서(cert.pem)가 필요한데, 이미 준비 되었다고 가정한다. 혹시 없다면, &lt;a href=&quot;http://wiki.dgoon.net/doku.php?id=ssl:%EC%9D%B8%EC%A6%9D%EC%84%9C_%EB%A7%8C%EB%93%A4%EA%B8%B0&quot; class=&quot;wikilink1&quot; title=&quot;ssl:인증서_만들기&quot;&gt;인증서 만들기&lt;/a&gt; 를 참고해서 만들면 된다.
여기(&lt;a href=&quot;http://docs.python.org/library/ssl.html&quot; class=&quot;urlextern&quot; title=&quot;http://docs.python.org/library/ssl.html&quot;  rel=&quot;nofollow&quot;&gt;http://docs.python.org/library/ssl.html&lt;/a&gt;)에 있는 샘플 코드의 Copy&amp;amp;Paste 및 정리이므로 영어가 된다면 저 문서를 읽는게 훨씬 낫다.
&lt;/p&gt;

&lt;p&gt;
키 생성까지 포함해서 &lt;a href=&quot;http://git.dgoon.net/?p=codesnippets.git;a=tree;f=ssl_wrap&quot; class=&quot;urlextern&quot; title=&quot;http://git.dgoon.net/?p=codesnippets.git;a=tree;f=ssl_wrap&quot;  rel=&quot;nofollow&quot;&gt;http://git.dgoon.net/?p=codesnippets.git;a=tree;f=ssl_wrap&lt;/a&gt; 여기에 커밋되어 있다.
&lt;/p&gt;

&lt;p&gt;
퍼포먼스, 스레딩 등은 전혀 고려되지 않은 샘플 코드 조각이므로 위험한 사용은 금할 것.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT29 SECTION &quot;SSL&quot; [1-715] --&gt;
&lt;h2 class=&quot;sectionedit30&quot;&gt;&lt;a name=&quot;echo_server&quot; id=&quot;echo_server&quot;&gt;Echo Server&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
#-*- encoding: utf-8 -*-

import sys, os, socket, ssl

if &amp;#039;__main__&amp;#039; == __name__:
    host, port = &amp;#039;localhost&amp;#039;, 9999
    if 1 &amp;lt; len(sys.argv): host = sys.argv[1]
    if 2 &amp;lt; len(sys.argv): port = int(sys.argv[2])

    if not (os.path.exists(&amp;#039;./cert.pem&amp;#039;) and os.path.exists(&amp;#039;./private.pem&amp;#039;)):
    	print(&amp;#039;cert.pem and private.pem should be prepared.&amp;#039;)
    	sys.exit(1)

    print(&amp;#039;Bind to %s:%d&amp;#039; % (host, port))

    bindsocket = socket.socket()
    bindsocket.bind((host, port))
    bindsocket.listen(5)

    while True:
        sock, fromaddr = bindsocket.accept()

        try:
            conn = ssl.wrap_socket(sock,
                                   server_side=True,
                                   certfile=&amp;quot;cert.pem&amp;quot;,
                                   keyfile=&amp;quot;private.pem&amp;quot;,
                                   ssl_version=ssl.PROTOCOL_TLSv1)
            data = conn.read()
            conn.write(data)
            conn.close()
        except:
            pass
&lt;/pre&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT30 SECTION &quot;Echo Server&quot; [716-1728] --&gt;
&lt;h2 class=&quot;sectionedit31&quot;&gt;&lt;a name=&quot;client&quot; id=&quot;client&quot;&gt;Client&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
#-*- encoding: utf-8 -*-
import sys, socket, ssl, pprint

if &amp;#039;__main__&amp;#039; == __name__:
	if 3 &amp;gt; len(sys.argv):
		print(&amp;#039;Usage: %s HOST PORT Messages...&amp;#039; % sys.argv[0])
		sys.exit(1)
	host, port = sys.argv[1:3]
	port = int(port)
	msg = &amp;#039; &amp;#039;.join(sys.argv[3:]) or &amp;#039;TEST&amp;#039;

	sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
	ssl_sock = ssl.wrap_socket(sock)
	ssl_sock.connect((host, port))

	print(&amp;quot;Send &amp;lt;&amp;lt; %s&amp;quot; % msg)
	ssl_sock.write(msg)
	recv_msg = ssl_sock.read()
	print(&amp;quot;Recv &amp;gt;&amp;gt; %s&amp;quot; % recv_msg)

	ssl_sock.close()

&lt;/pre&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT31 SECTION &quot;Client&quot; [1729-] --&gt;</description>
            <author>dgoon</author>
        <category>python</category>
            <pubDate>Fri, 12 Aug 2011 18:13:06 +0900</pubDate>
        </item>
    </channel>
</rss>

