ShibuyaLisp4 » 履歴 » バージョン 25
Yuumi Yoshida, 2015-08-03 22:24
| 1 | 25 | Yuumi Yoshida | # Shibuya.lisp TT#4 「ふつうのLisp入門」 |
|---|---|---|---|
| 2 | 1 | Yuumi Yoshida | |
| 3 | 11月7日開催の "Shibuya.lisp TT#4":http://shibuya.lisp-users.org/ でLispの初心者向けセッションを行います。 |
||
| 4 | |||
| 5 | 25 | Yuumi Yoshida | |
| 6 | 1 | Yuumi Yoshida | 受講する方は、以下を予めPCにインストールしてきて下さい (会場では無線/有線LANは使えませんのでご注意下さい)。 |
| 7 | |||
| 8 | |||
| 9 | 25 | Yuumi Yoshida | ## 1. Lisp(Scheme)の処理系 |
| 10 | |||
| 11 | 今回はLisp(Scheme)の処理系として [Gauche](http://practical-scheme.net/gauche/index-j.html) を使います。 |
||
| 12 | |||
| 13 | 1 | Yuumi Yoshida | Gaucheの最新版は 0.8.14 ですが、0.8.12, 0.8.13でもかまいません。 |
| 14 | |||
| 15 | 25 | Yuumi Yoshida | |
| 16 | 1 | Yuumi Yoshida | インストール手順: |
| 17 | 15 | Yuumi Yoshida | |
| 18 | 25 | Yuumi Yoshida | #### Winodws |
| 19 | 1 | Yuumi Yoshida | |
| 20 | 25 | Yuumi Yoshida | 1. "コンパイル済Windows用バイナリ (実験中)":http://practical-scheme.net/vault/Gauche-mingw-0.8.14.zip をダウンロード |
| 21 | 1. 適当なディレクトリー、例えば C:¥ に展開します。 |
||
| 22 | 1. 環境変数 PATH に上で展開したGaucheの binディレクトリーのパスを追加します、C:¥ に展開した場合は C:¥Gauche¥bin をPATHに追加 |
||
| 23 | 1. DOS窓で以下のように gosh (Gauche) を実行しバージョン番号が表示されれば OK |
||
| 24 | |||
| 25 | ~~~ |
||
| 26 | 1 | Yuumi Yoshida | C:¥>gosh -V |
| 27 | Gauche scheme interpreter, version 0.8.14 [utf-8] |
||
| 28 | C:¥> |
||
| 29 | 25 | Yuumi Yoshida | ~~~ |
| 30 | 1 | Yuumi Yoshida | |
| 31 | 25 | Yuumi Yoshida | #### Mac (Leapoad, Tiger) |
| 32 | 1 | Yuumi Yoshida | |
| 33 | portでインストールするのが簡単です。 |
||
| 34 | |||
| 35 | 25 | Yuumi Yoshida | |
| 36 | ~~~ |
||
| 37 | % sudo port install gauche |
||
| 38 | % gosh -V |
||
| 39 | 1 | Yuumi Yoshida | Gauche scheme interpreter, version 0.8.13 [utf-8,pthreads] |
| 40 | 25 | Yuumi Yoshida | % |
| 41 | ~~~ |
||
| 42 | 3 | Yuumi Yoshida | |
| 43 | 1 | Yuumi Yoshida | |
| 44 | 3 | Yuumi Yoshida | |
| 45 | 25 | Yuumi Yoshida | #### Mac (Snow-Leapoad) |
| 46 | 3 | Yuumi Yoshida | |
| 47 | 1 | Yuumi Yoshida | 今のところ、port一発では入りませんが、以下の手順でインストールできます。 |
| 48 | 25 | Yuumi Yoshida | |
| 49 | ~~~ |
||
| 50 | % sudo port install libiconv +universal |
||
| 51 | % sudo port install gdbm +universal |
||
| 52 | % sudo port install gauche build_arch=i386 |
||
| 53 | % gosh -V |
||
| 54 | 3 | Yuumi Yoshida | Gauche scheme interpreter, version 0.8.13 [utf-8,pthreads] |
| 55 | 25 | Yuumi Yoshida | % |
| 56 | ~~~ |
||
| 57 | 5 | Yuumi Yoshida | |
| 58 | 25 | Yuumi Yoshida | * 既に gaucheインストルを試みて失敗している方は最初に **sudo port clean gauche** を実行して下さい |
| 59 | 1 | Yuumi Yoshida | * 上のインストル手順は "Ehrenの日記":http://d.hatena.ne.jp/Ehren/20091003/1254587223 , "武蔵の日記":http://d.hatena.ne.jp/sirocco634/20091004/1254624559 を参考にしました。 |
| 60 | 4 | Yuumi Yoshida | |
| 61 | 25 | Yuumi Yoshida | #### Linux等 |
| 62 | 4 | Yuumi Yoshida | |
| 63 | Debian,Ubuntuは apt でインストールできます。 |
||
| 64 | 25 | Yuumi Yoshida | |
| 65 | 4 | Yuumi Yoshida | それ以外のLinux/Unixでは "ソース":http://prdownloads.sourceforge.net/gauche/Gauche-0.8.14.tgz をダウンロドして make installして下さい。 |
| 66 | 25 | Yuumi Yoshida | |
| 67 | ~~~ |
||
| 68 | % gzcat Gauche-0.8.14.tgz | tar xf - |
||
| 69 | % cd Gauche-0.8.14 |
||
| 70 | % ./configure |
||
| 71 | % make |
||
| 72 | % make test |
||
| 73 | % sudo make install |
||
| 74 | % gosh -V |
||
| 75 | 22 | Yuumi Yoshida | Gauche scheme interpreter, version 0.8.14 [utf-8,pthreads] |
| 76 | 25 | Yuumi Yoshida | % |
| 77 | ~~~ |
||
| 78 | 3 | Yuumi Yoshida | |
| 79 | 6 | Yuumi Yoshida | |
| 80 | 25 | Yuumi Yoshida | ## 2. rlwrap (Mac,Linux のみ) |
| 81 | 6 | Yuumi Yoshida | |
| 82 | gosh にはGNU readline は組み込まれていませんので、gosh を便利に使うために "rlwrap":http://freshmeat.net/projects/rlwrap/ をインストールする事をお薦めします。 |
||
| 83 | 3 | Yuumi Yoshida | |
| 84 | 25 | Yuumi Yoshida | |
| 85 | 3 | Yuumi Yoshida | インストルは |
| 86 | 25 | Yuumi Yoshida | |
| 87 | 6 | Yuumi Yoshida | * Mac: sudo port install rlwarp |
| 88 | * Debian,Ubuntu: sudo apt-get install rlwarp |
||
| 89 | * その他: "ソースをここ":http://freshmeat.net/projects/rlwrap/ からダウンロードし make install |
||
| 90 | 8 | Yuumi Yoshida | |
| 91 | 1 | Yuumi Yoshida | |
| 92 | 14 | Yuumi Yoshida | |
| 93 | 25 | Yuumi Yoshida | ## 3. Lispコードをシンタックスハイライト出来るエディター |
| 94 | 21 | Yuumi Yoshida | |
| 95 | 16 | Yuumi Yoshida | Lispのプログラミングを支援(対応カッコのハイライト、インデント…)してくれるエディターをインストールする事をお薦めします。 |
| 96 | |||
| 97 | 25 | Yuumi Yoshida | |
| 98 | 19 | Yuumi Yoshida | * Emacs (Windowsの場合は "Meadow":http://www.meadowy.org/meadow/) |
| 99 | 23 | Yuumi Yoshida | * Vim |
| 100 | 19 | Yuumi Yoshida | * "Textmate":http://macromates.com/ (どうしてもMac的なエディターが使いたい方むけ) |
| 101 | 24 | Yuumi Yoshida | * "Notepad++":http://sourceforge.net/projects/notepad-plus/ (どうしてもWindows的なエディターが使いたい方むけ) |
| 102 | 1 | Yuumi Yoshida | * その他 |
| 103 | |||
| 104 | Emacs,Vim等のインストールはネット上の情報を参考にして下さい。今回は、最低限のインストールが出来ていれば良いと思います。 |
||
| 105 | |||
| 106 | |||
| 107 | 25 | Yuumi Yoshida | |
| 108 | ## テキスト・サンプルコード |
||
| 109 | 1 | Yuumi Yoshida | |
| 110 | テキスト・サンプルコードは http://ey-office.net/redmine/attachments/28/shibuya_lisp4.zip をダウンロードしPC上で展開して下さい。 |