* Menu
[[About:self:AboutPage.txt]] | [[Profile:http://iddy.jp/profile/southly/]] | [[まとめ:self:1163859357.txt]] | [[オリジナル:http://ninjinix.x0.com/rn/]] | [[xyzzy:http://raido.sakura.ne.jp/southly/xyzzy/site-lisp/]] | [[あんてな:http://i-know.jp/southly/listall]] | [[■:http://raido.sakura.ne.jp/southly/lisp/ni/view.lisp]] | [[buzz:http://www.google.com/profiles/southly#buzz]]
* xyzzy lisp : shell-modeで色付け
(in-package "editor")
(add-hook '*shell-mode-hook*
#'(lambda ()
(make-local-variable 'regexp-keyword-list)
(setq regexp-keyword-list (compile-regexp-keyword-list
`((,*shell-prompt-regexp* t (:color 3 0) nil 0 0))))))
* xyzzy lisp : 位置とサイズの操作
* 素数を求める。
とりあえず、アルゴリズム事典から。
よりLispらしく。
よりLispらしく。
(defun generatePrimes (n)
(let ((k 0)
(prime (make-vector n :fill-pointer 0)))
(vector-push 2 prime)
(incf k)
(do ((x 3 (+ x 2))
(i 0 0))
((>= k n))
(while (and (< i k) (/= 0 (rem x (aref prime i))))
(incf i))
(when (= i k)
(vector-push x prime)
(incf k)))
prime))
