[logaling-commit] logaling/logalimacs [master] Use nthcdr instead of loop

Back to archive index

Yuta Yamada null+****@clear*****
Thu Aug 23 17:07:10 JST 2012


Yuta Yamada	2012-08-23 17:07:10 +0900 (Thu, 23 Aug 2012)

  New Revision: 6057a077f157bb91165447bcf45e85cdffbfeb9a
  https://github.com/logaling/logalimacs/commit/6057a077f157bb91165447bcf45e85cdffbfeb9a

  Log:
    Use nthcdr instead of loop

  Modified files:
    logalimacs.el

  Modified: logalimacs.el (+5 -7)
===================================================================
--- logalimacs.el    2012-08-23 15:47:57 +0900 (6642ab7)
+++ logalimacs.el    2012-08-23 17:07:10 +0900 (b8c61e1)
@@ -207,13 +207,11 @@ Example:
         finally return (mapconcat 'identity commands ",")))
 
 (defun loga-mixture-bracket (command-prefix command)
-  (loop with command = (loga-from-symbol-to-string command)
-        with prefix = (char-to-string command-prefix)
-        with rest = '()
-        for i from 1 upto (1- (length command))
-        collect (char-to-string (aref command i)) into rest
-        finally return (concat prefix ")"
-                               (mapconcat 'identity rest ""))))
+  (let* ((command (loga-from-symbol-to-string command))
+         (prefix  (char-to-string command-prefix))
+         (list-of-rest (nthcdr 2 (string-to-list (split-string command ""))))
+         (rest (mapconcat 'identity list-of-rest "")))
+    (concat prefix ")" rest)))
 
 ;;;###autoload
 (defun loga-interactive-command ()
-------------- next part --------------
An HTML attachment was scrubbed...
다운로드 



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