[logaling-commit] logaling/logalimacs [master] Use the for and with statement instead of local variable of let*

Back to archive index

null+****@clear***** null+****@clear*****
Wed Jun 13 20:09:01 JST 2012


yuta yamada	2012-06-13 20:09:01 +0900 (Wed, 13 Jun 2012)

  New Revision: ce52d2dbad1224aaac75634fcbc0053e0b371e13

  Log:
    Use the for and with statement instead of local variable of let*

  Modified files:
    logalimacs.el

  Modified: logalimacs.el (+8 -8)
===================================================================
--- logalimacs.el    2012-06-13 19:59:00 +0900 (6e3ce90)
+++ logalimacs.el    2012-06-13 20:09:01 +0900 (1651b28)
@@ -280,14 +280,14 @@
     (mapconcat 'identity striped-list "\n")))
 
 (defun loga-format (words size)
-  (let* (record source-length target-length)
-    (loop for (source target note) in words do
-          (setq source-length (loga-compute-length source)
-                target-length (loga-compute-length target))
-          (if (and (loga-less-than-window-half-p source-length target-length)
-                   (> loga-width-limit-source source-length))
-              (push (loga-append-margin source target note size) record)))
-    record))
+  (loop with record = '()
+        for (source target note) in words
+        for source-length = (loga-compute-length source)
+        for target-length = (loga-compute-length target)
+        if (and (loga-less-than-window-half-p source-length target-length)
+                (> loga-width-limit-source source-length))
+        do (push (loga-append-margin source target note size) record)
+        finally return record))
 
 (defun loga-compute-max-length (words)
   (loop with max-source-length = 0




More information about the logaling-commit mailing list
Back to archive index