Next: 1.5 Emacs Lisp
Up: 1 Lisp言語
Previous: 1.3 商用Common lisp
CommonLispの処理系としては,Clispというのがありダウンロードして利用する
ことができる.
http://clisp.cons.org/
http://clisp.sourceforge.net/
ANSI 標準の Common Lispのほとんどの部分をサポートしている.
現在のバージョンはclisp-2.33.2となっている.
このバージョンのソースclisp-2.33.2.tar.gzなどをダウンロードし,
configureを行い,最後のメッセージに下のようなものが表示されるので
それを順に実行する.
clisp-2.33.2/unix/INSTALLにインストール方法が記してある.
~/lecture/soft3/note04/clisp/clisp-2.33.2> ./configure
executing
clisp-2.33.2/src/configure --cache-file=config.cache
configure: creating cache config.cache
configure: * checks for programs
...
To continue building CLISP,
the following commands are recommended
(cf. unix/INSTALL step 4):
cd src
./makemake --with-dynamic-ffi > Makefile
make config.lisp
vi config.lisp
# The default stack size on your platform is insufficient
# and must be increased to at least 8192. You must do either
# 'ulimit -s 8192' (for Bourne shell derivatives, e.g., bash and zsh) or
# 'limit stacksize 8192' (for C shell derivarives, e.g., tcsh)
make
make check
~/lecture/soft3/note04/clisp/clisp-2.33.2>
最後に make installを行うと,/usr/local/bin/clisp
としてインストールされる.
~> clisp
i i i i i i i ooooo o ooooooo ooooo ooooo
I I I I I I I 8 8 8 8 8 o 8 8
I \ `+' / I 8 8 8 8 8 8
\ `-+-' / 8 8 8 ooooo 8oooo
`-__|__-' 8 8 8 8 8
| 8 o 8 8 o 8 8
------+------ ooooo 8oooooo ooo8ooo ooooo 8
Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi,
Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2004
*** - invalid byte #x83 in CHARSET:ASCII conversion
Break 1 [1]> :q
[1]> (car '(a b c))
A
[2]> (defun fib (n)
(if (< n 2) 1 (+ (fib (- n 1) (- n 2)))))
FIB
[3]> (fib 19)
*** - EVAL/APPLY: too many arguments given to FIB
Break 1 [4]> :reset
:RESET
Break 1 [4]> :q
[5]> (defun fib (n)
(if (< n 2) 1 (+ (fib (- n 1)) (fib (- n 2)))))
FIB
[6]> (fib 19)
6765
[7]> (exit)
Bye.
generated through LaTeX2HTML. M.Inaba 平成18年5月7日