* Menu
[[About:self:AboutPage.txt]] | [[Profile:file/southly/]] | [[まとめ:self:1163859357.txt]] | [[オリジナル:http://ninjinix.x0.com/rn/]] | [[xyzzy:lisp/]] | [[あんてな:listall]] | [[■:lisp]] | [[buzz:files/southly#buzz]]
- Scrapbook : WebScheme - Scheme interpreter for web applications
- Scrapbook : ここにいるだれか - フライパンでパスタ作ってみた
- Scrapbook : 【イーブックオフ】日本最大級のオンライン中古書店
- Scrapbook : 【古本・古書(販売/買取)】本を愛する人の総合サイト・スーパー源氏
- Scrapbook : 日本の古本屋 - 日本最大の古本検索サイト
- Scrapbook : B3 OS/Programming
- lisp : 値渡し?参照渡し?
- xyzzy lisp : シャッフル
- xyzzy lisp : ミニバッファの入力にエスケープシーケンス
- Scrapbook : 気の利いたscanf -- part 1
- xyzzy topic : attribute, M -- Masahiro Ohba's Bryce Gallery
- xyzzy topic : 継続にっき - dabbrev-highlightもどき on xyzzy , RSS feed
- 2007-03-29 (昼)
- 2007-03-29
- 2007-03-27
page 9 - << : 0 : 1 : 2 : 3 : 4 : 5 : 6 : 7 : 8 : 9 : 10 : 11 : 12 : 13 : 14 : 15 : 16 : 17 : 18 : 19 : 20 : 21 : 22 : 23 : 24 : 25 : 26 : 27 : 28 : 29 : 30 : 31 : 32 : 33 : 34 : 35 : 36 : 37 : 38 : >>
* Scrapbook : WebScheme - Scheme interpreter for web applications
* Scrapbook : ここにいるだれか - フライパンでパスタ作ってみた
http://d.hatena.ne.jp/maname/20070407
* Scrapbook : 【イーブックオフ】日本最大級のオンライン中古書店
off.co.jp/index.jsp
* Scrapbook : 【古本・古書(販売/買取)】本を愛する人の総合サイト・スーパー源氏
http://sgenji.jp/
* Scrapbook : 日本の古本屋 - 日本最大の古本検索サイト
http://www.kosho.or.jp/servlet/top
* Scrapbook : B3 OS/Programming
http://www.csg.is.titech.ac.jp/~chiba/lecture/os/index.html
* lisp : 値渡し?参照渡し?
関数一般についてはこの辺りが参考になります。
Schemeの話ですけど基本的に一緒。
Schemeの話ですけど基本的に一緒。
* xyzzy lisp : シャッフル
(defun nswap (l x y) (rotatef (car (nthcdr x l)) (car (nthcdr y l))) l) (defun nshuffle (l) (do ((i (length l) (1- i))) ((>= 1 i)) (setq l (nswap l (1- i) (random i)))) l)元のデータを直接いじっていくほうが分かりやすくないッスか?
ってことでこんな。
nswapは関数にする必要は無いけど意味が分かりやすいように。
* xyzzy lisp : ミニバッファの入力にエスケープシーケンス
interactive指定子を作っちゃえば楽に置き換えられるんじゃね?
ってことで、こんな。
ってことで、こんな。
(in-package "editor") (defun interactive-read-string-with-escape-sequence (prompt default history title) (list (decode-escape-sequence (read-string prompt :default default :history history) nil))) (pushnew '(#\w . interactive-read-string-with-escape-sequence) *interactive-specifier-alist* :test #'equal) (defun interactive-read-regexp-with-escape-sequence (prompt default history title) (list (decode-escape-sequence (read-string prompt :default default :history history) t))) (pushnew '(#\W . interactive-read-regexp-with-escape-sequence) *interactive-specifier-alist* :test #'equal) ;; こんな感じで使う ;; 文字列 (defun search-forward-wes (pattern &optional noerror) (interactive "wSearch forward: " :default0 *last-search-string* :history0 'search) (search-command pattern nil nil (interactive-p) noerror)) ;; 正規表現 (defun re-search-forward-wes (regexp &optional noerror) (interactive "WRe-search forward: " :default0 *last-search-regexp* :history0 'search) (search-command regexp nil t (interactive-p) noerror)) (export '(search-forward-wes re-search-forward-wes)) (in-package "user")
* Scrapbook : 気の利いたscanf -- part 1
* xyzzy topic : attribute, M -- Masahiro Ohba's Bryce Gallery
* xyzzy topic : 継続にっき - dabbrev-highlightもどき on xyzzy , RSS feed
http://www.callcc.net/diary/20060813.html#p01
* 2007-03-29 (昼)
- 続きそうなので Xyzzy Wiki に場所を移しましょうか。
- shadowの件は納得です。ただ、unintern より makunbound の方がより直接的な気がします。
- ということで実験。
; 普通の状況 (progn (setq x 1) (defun f() x) ((lambda (x) (f)) 2)) =>1
; スペシャル変数に昇格 (progn (setq x 1) (defun f() x) ((lambda (x) (declare (special x)) (f)) 2)) =>2
; 束縛を解消 (progn (setq x 1) (defun f() x) ((lambda (x) (declare (special x)) (makunbound 'x) (f)) 2)) ->変数が定義されていません: x
; 束縛を解消その二 (progn (setq x 1) (defun f() x) (defun g() (makunbound 'x) (f)) ((lambda (x) (declare (special x)) (g)) 2)) ->変数が定義されていません: x
* 2007-03-29
- そのshadowの意図はよく分からんス。パッケージが絡んでいないので影響は無い気がします。
- 理解が深まるので議論は歓迎です。
- 変数とスコープは不可分だとは思いますけど、スコープの話はスコープについて一度まとめてからやった方がよいでしょう。
* 2007-03-27
- 「On Lisp」確保
- 赤塚さんのxyzzyの説明がなくなってるなぁ
- abbrev, インデント, コンパイルはいりそうな気がする
- 「変数の種類」という観点からの説明だから、個々の状況の説明まではしなかったんだよなぁ
- ダイナミックスコープってそういうものというか、環境を超える効果を持っているのがスペシャル変数というイメージですね>「スペシャルであるかどうかということは環境の古いものから引き継ぐ」
; トップレベル (setq x 1) ; 実験用関数 (defun f() x) ; lexicalな束縛 ((lambda (x) (f)) 2) => 1 ; (declare (special x)) によって、この環境ではxがスペシャル変数に昇格 ((lambda (x) (declare (special x)) (f)) 2) => 2 ; また新しい環境なので通常のlexicalな束縛 ((lambda (x) (f)) 2) => 1
page 9 - << : 0 : 1 : 2 : 3 : 4 : 5 : 6 : 7 : 8 : 9 : 10 : 11 : 12 : 13 : 14 : 15 : 16 : 17 : 18 : 19 : 20 : 21 : 22 : 23 : 24 : 25 : 26 : 27 : 28 : 29 : 30 : 31 : 32 : 33 : 34 : 35 : 36 : 37 : 38 : >>