[Common Lisp] clouseau:inspector
McCLIM に GUI のインスペクタが付いている。
(clouseau:inspector clim-internals::*command-tables* :new-process t)
使い方がよく分からないが、値の変更やメソッドの削除なんかもできそう。
McCLIM に GUI のインスペクタが付いている。
(clouseau:inspector clim-internals::*command-tables* :new-process t)
使い方がよく分からないが、値の変更やメソッドの削除なんかもできそう。
Climacs も (require :mcclim-freetype) で日本語表示できた。UTF-8 で書いた日本語を含むファイルのオープン、セーブできた。カーソル移動や C-t もちゃんと動作する。XIM は未サポートのよう。XIM をなんとかするか、SKK を移植すれば Climacs の中で生きていけるかも。
ちゃんと Lisp コードにも色が付く。まだ使い方が全然分からないけど Climacs おもしろい♪
(eval-when (:compile-toplevel :load-toplevel :execute)
(require :mcclim)
(require :mcclim-freetype)
(require :climacs))
(climacs:climacs :new-process t)
mcclim/Experimental/freetype/mcclim-freetype.asd を require したら日本語表示できた♪
(eval-when (:compile-toplevel :load-toplevel :execute)
(require :mcclim)
(require :mcclim-freetype))
(in-package :clim-user)
(define-application-frame hello-frame ()
()
(:pane (make-pane 'application-pane :display-function #'display-hello))
(:geometry :width 400 :height 200))
(defmethod display-hello ((hello-frame hello-frame) stream)
(format stream "こんにちは! Hello World! 日本語だ!"))
(defun run ()
(run-frame-top-level (make-application-frame 'hello-frame)))
;;(run)
Common Lisp のライブラリ環境をそろえるのに幾つか方法があると思うが、私がどうしているかを書いておく。
Debian を使用。基本的に Debian のパッケージがあるものは Debian のパッケージを使う。
パッケージのないもの、あっても最新バージョンが欲しいものは~/letter/lisp/lib の下に各リポジトリからチェックアウトしている。Common Lisp 界は darcs が多かったけど git が主流になりつつある気がする。それらを asdf:*central-registry* に登録するために下記のようにcl-fad を使っている。
Debian パッケージもリポジトリの公開もないものは asdf-insatll している。
あとライブラリを探すときは CLiki と The Common Lisp Directory を参照する。
~/.sbclrc はこうなっている。
;;;;; -*-lisp-*-
;;デバッグ用セッティング
(declaim (optimize debug safety))
;; for debug
(defmacro p (&body body)
`(progn ,@(mapcar #'(lambda (arg)
`(format t "~30a ; => ~a~%" ',arg ,arg))
body)))
(setf (logical-pathname-translations "ancient")
`(("**;*.*" "/home/ancient/letter/lisp/**/*.*")))
;; for tama
(pushnew (translate-logical-pathname "ancient:web;tama;")
asdf:*central-registry* :test 'equal)
;; ~/letter/lib 以下の asd を登録する。
(require :cl-fad)
(cl-fad:walk-directory
(translate-logical-pathname "ancient:lib;")
#'(lambda (path)
(let ((pd (pathname-directory path)))
(unless (member "_darcs" pd :test #'equal)
(pushnew
(make-pathname :directory pd)
asdf:*central-registry*
:test #'equal))))
:test #'(lambda (path)
(string-equal "asd" (pathname-type path))))
;;; If the first user-processable command-line argument is a filename,
;;; disable the debugger, load the file handling shebang-line and quit.
(let ((script (and (second *posix-argv*)
(probe-file (second *posix-argv*)))))
(when script
;; Handle shebang-line
(set-dispatch-macro-character #\# #\!
(lambda (stream char arg)
(declare (ignore char arg))
(read-line stream)))
;; Disable debugger
(setf *invoke-debugger-hook*
(lambda (condition hook)
(declare (ignore hook))
;; Uncomment to get backtraces on errors
;; (sb-debug:backtrace 20)
(format *error-output* "Error: ~A~%" condition)
(quit)))
(load script)
(quit)))
他の人たちはどうしてるんだろう?
処理系は SBCL とします。Drakma等は asdf-install を使って次のようにインストールするのが簡単だと思います。asdf-install は SBCL に付属しています。他には clbuild を使う方法もあります。
CL-USER> (require :asdf-install)
("ASDF-INSTALL")
CL-USER> (asdf-install:install :drakma)
Install where?
1) System-wide install:
System in /usr/lib/sbcl/site-systems/
Files in /usr/lib/sbcl/site/
2) Personal installation:
System in /home/ancient/.sbcl/systems/
Files in /home/ancient/.sbcl/site/
--> 2
ここで 2 を入力してください。
No key found for key id 0x#1=595FF045057958C6. Try some command like
gpg --recv-keys 0x#1#
[Condition of type ASDF-INSTALL::KEY-NOT-FOUND]
Restarts:
0: [SKIP-GPG-CHECK] Don't check GPG signature for this package
1: [ABORT] Return to SLIME's top level.
2: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" {10034FE621}>)
みたいなのが表示されたら 0 を入力してください。あと同様に cl-ppcre 等をインストールしてください。
(asdf-install:install :cl-ppcre)
(asdf-install:install :cl-interpol)
(asdf-install:install :s-xml)
各ライブラリのサイトはこちら
cl-win32ole を CodeRepos に移動しました。もしよかったらいじってやってください。
svn checkout http://svn.coderepos.org/share/lang/commonlisp/cl-win32ole/trunk cl-win32ole