Re: case 構文のキーを括弧でくくると何が変わるのか
http://d.hatena.ne.jp/kitokitoki/20101001/p1
Common Lispは実装がいっぱいあるので、SBCLだけで考えると問題がある気がする。と思って他の処理系で実験。WindowsでのABCLとClozure Common Lisp。
;; ABCL 0.18.0 (defvar letter 'u) ;; => LETTER (case letter (s 's) (t 't) (u 'u) (otherwise 'nothing)) ;; => T (case letter ((s) 's) ((t) 't) ((u) 'u) (otherwise 'nothing)) ;; => U
;; Welcome to Clozure Common Lisp Version 1.4-r13122 (WindowsX8632)! (defvar letter 'u) ;; => LETTER (case letter (s 's) (t 't) (u 'u) (otherwise 'nothing)) ; Warning: T or OTHERWISE clause in the middle of a CASE statement. Subsequent clauses ignored. ; While executing: CCL::CASE-AUX, in process listener(1). ;; => T (case letter ((s) 's) ((t) 't) ((u) 'u) (otherwise 'nothing)) ;; => U
ABCLは PAIPの説明通りの動き、CCLは括弧で括らないと警告された上でPAIPの説明通りの動きでした。
よく分からないけど「処理系依存を避けるなら、やっぱり括弧で囲んだほうがいい」と思ったのでした。