null+****@clear*****
null+****@clear*****
Fri Jun 8 01:06:27 JST 2012
yuta yamada 2012-06-08 01:06:27 +0900 (Fri, 08 Jun 2012) New Revision: 4eaeb7ac1999fcc9420679ef81442a1707a6caa4 Log: Use the if and else statement instead of the cond statement Modified files: logalimacs.el Modified: logalimacs.el (+6 -7) =================================================================== --- logalimacs.el 2012-06-08 00:18:29 +0900 (02d30ba) +++ logalimacs.el 2012-06-08 01:06:27 +0900 (f8b747c) @@ -308,13 +308,12 @@ (defun loga-compute-length (sentence) (loop with sum = 0 with tokens = (string-to-list (split-string sentence "")) - for token in tokens do - (cond - ((equal "" token) t) - ((and (multibyte-string-p token) - (loga-correct-character-p token)) - (setq sum (+ sum 2))) - (t (setq sum (+ sum 1)))) + for token in tokens + if (and (null (equal "" token)) + (multibyte-string-p token) + (loga-correct-character-p token)) + do (setq sum (+ sum 2)) + else do (setq sum (+ sum 1)) finally return sum)) (defun loga-correct-character-p (token)