This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; パッケージと同じ prefix を持つ関数を export するコードを生成する。 | |
| (defun insert-export-functions () | |
| (interactive "*") | |
| (let* ((prefixs (cons (package-name *buffer-package*) | |
| (package-nicknames *buffer-package*))) | |
| (prefix-re (format nil "^\\(~{~A~^\\|~}\\)-" prefixs))) | |
| (insert "(export '())") | |
| (backward-char 2) | |
| (dolist (func (mapcar #'cadr (ed::lisp-build-summary-of-functions))) | |
| (when (string-match prefix-re func) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Ruby + htmlfile + JavaScript-XPath で XPath | |
| # | |
| # Example: | |
| # | |
| # > ruby htmlfile-xpath.rb http://gist.github.com/gists "//div[@class='info']/span/a" | |
| # gist: 497491 | |
| # gist: 497481 | |
| # gist: 497469 | |
| # : | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; xyzzy + htmlfile + JavaScript-XPath で XPath | |
| ;; | |
| ;; See: | |
| ;; http://d.hatena.ne.jp/amachang/20071112/1194856493 | |
| ;; http://d.hatena.ne.jp/mobitan/20090829/1251542456#20090829f10 | |
| (require "xml-http-request") | |
| (defparameter *javascript-xpath-uri* | |
| "http://svn.coderepos.org/share/lang/javascript/javascript-xpath/trunk/release/javascript-xpath-latest-cmp.js") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; バイトコンパイルあり・なしでのjsonのベンチマーク | |
| (require "json") | |
| (require "xml-http-request") | |
| (defmacro benchmark (&body body) | |
| `(let (times result) | |
| (dotimes (i 4) | |
| (gc t) | |
| (message "~[Warm up~:;Round ~:*~A~]" i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; StackStockBooks のもう読み終えた本のリストを取得して ChangeLog 形式で生成する | |
| ;; http://stack.nayutaya.jp/ | |
| (defpackage :stack-stock-books | |
| (:nicknames :ssb) | |
| (:use :lisp :editor)) | |
| (in-package :stack-stock-books) | |
| (export '(StackStockBooksの読み終えたリストをChangeLog形式で生成 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; xyzzy Lisp から現在のアプリケーションのデバッガに文字列を送信 | |
| ;; | |
| ;; == 送信した文字列を見る方法 == | |
| ;; | |
| ;; * 方法1: | |
| ;; VisualStudio から xyzzy をデバッグ実行すると | |
| ;; VisualStudio のウィンドウ内で見れるとおもう(たぶん) | |
| ;; | |
| ;; * 方法2: | |
| ;; Sysinternals Suite に含まれる DebugView.exe を起動 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 以下の 2 つのファイルの diff | |
| * http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/iter/loop/cmu/cmu_loop.cl | |
| * http://github.com/southly/xyzzy.src/blob/0.2.2.235/lisp/cmu_loop.l | |
| --- cmu_loop.cl 2010-08-06 16:46:20.171500000 +0900 | |
| +++ cmu_loop.l 2007-03-10 14:33:22.000000000 +0900 | |
| @@ -119,7 +119,8 @@ | |
| ;;; did put in a comment at the use of string=. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xyzzy に標準でついてくる cmu_loop.l は it に対応していないので、 | |
| CMUCL の loop マクロを xyzzy に移植してみた。 | |
| ext:valid-function-name-p はサポっている。 | |
| http://common-lisp.net/cgi-bin/viewcvs.cgi/src/code/loop.lisp?root=cmucl&view=markup | |
| Index: loop.lisp | |
| =================================================================== | |
| RCS file: /project/cmucl/cvsroot/src/code/loop.lisp,v | |
| retrieving revision 1.34 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; CMUCL の loop マクロを xyzzy に移植したもので実践 Common Lisp のサンプルを動かして結果。 | |
| ;; collect it を含めて一応全部動いているみたい。 | |
| ;; http://gist.github.com/511132 | |
| (loop for i upto 10 collect i) | |
| (0 1 2 3 4 5 6 7 8 9 10) | |
| (loop for i from 0 downto -10 collect i) | |
| (0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; 「名前が衝突するためexportできません: hoge」を解消する | |
| ;; 衝突しているシンボルを unintern して回る | |
| (defun find-conflict-symbols (sym) | |
| (let ((name (symbol-name sym)) | |
| r) | |
| (dolist (pkg (list-all-packages)) | |
| (multiple-value-bind (found table) | |
| (find-symbol name pkg) | |
| (when (and found (eql table :internal) |