DreamHostにGaucheをインストール

ものすごく簡単。

(hogehogeはユーザー名)

$ ssh hogehoge@piyo.dreamhost.com
Password: ********

$ mkdir usr
$ wget http://prdownloads.sourceforge.net/gauche/Gauche-0.8.9.tgz
$ tar zxvf Gauche-0.8.9.tgz
$ rm Gauche-0.8.9.tgz
$ cd Gauche-0.8.9/
$ ./configure --prefix=/home/hogehoge/usr --enable-multibyte=utf-8 --enable-threads=pthreads --enable-ipv6
$ make && make install
$ export PATH=/home/hogehoge/usr/bin:$PATH
$ gosh -V
Gauche scheme interpreter, version 0.8.9 [utf-8,pthreads]

Lispといったら竹内関数(あるいは たらいまわし関数)だよね。

$ gosh
gosh> (define tak (lambda (x y z) (cond ((> x y) (tak (tak (- x 1) y z) (tak (- y 1) z x) (tak (- z 1) x y))) (#t y))))
tak
gosh> (time (tak 12 6 0))                                                                 
;(time (tak 12 6 0))
; real   1.845
; user   1.760
; sys    0.020
12
gosh> (exit)

DreamHost上でもちゃんと動く。shiroさんのWiLiKiが動いてるから当たり前だけど。