2007-01-07から1日間の記事一覧

クラスの名前はただの定数でしかないということは

その定数を適当な変数にコピーして,その変数はnewを使えたりするってことだ. class Hoge def hello puts "hello" end end a = Hoge.new a.hello => hello p Hoge => Hoge hoge = Hoge.dup b = hoge.new b.hello => hello p hoge => #<Class:0x4998c8> fuga = Hoge c = fuga</class:0x4998c8>…

ANSI Common Lisp 3章 「リスト」

チマチマと練習問題をやってみた. 2. もとのリストでの要素の並びを保持するように動作するunion (defun new-union (lst oth) (if (null lst) oth (funcall #'(lambda () (dolist (elt lst) (setf oth (remove elt oth))) (append lst oth))))) > (union '(…

今年のカレンダー

今年は,ちゃんとしたカレンダーを手に入れた. 物はというと,SUBARU(富士重工)のディーラにもらった,2007 SUBARU MOTORSPORTS CALENDARという,ひたすらIMPREZAがかっこよくWRCを疾走する姿の写真が納められた,なんとも素敵なカレンダー. IMPREZAは,一…