Commit dbd9624e authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(mapthread): Delete it.

(combinatorial): New function.
(indian--puthash-cv): Use combinatorial instead of mapthread.
parent deb05c92
2009-08-24 Kenichi Handa <handa@m17n.org>
* language/ind-util.el (mapthread): Delete it.
(combinatorial): New function.
(indian--puthash-cv): Use combinatorial instead of mapthread.
2009-08-22 Kevin Ryde <user42@zip.com.au> 2009-08-22 Kevin Ryde <user42@zip.com.au>
* emacs-lisp/checkdoc.el (checkdoc-force-history-flag) * emacs-lisp/checkdoc.el (checkdoc-force-history-flag)
......
...@@ -382,21 +382,12 @@ ...@@ -382,21 +382,12 @@
(;; misc (;; misc
nil ".m" ".h" "'" nil "." nil))) nil ".m" ".h" "'" nil "." nil)))
(defun mapthread (function seq1 &rest seqrest) (defun combinatorial (head &rest tail)
"Apply FUNCTION to each element of SEQ1 and return result list. (if tail
If there are several SEQRESTs, FUNCTION is called with that many (apply 'append
arguments, with all possible combinations of these multiple SEQUENCES. (mapcar (lambda (y) (mapcar (lambda (x) (cons x y)) head))
Thus, if SEQ1 contains 3 elements and SEQ2 contains 5 elements, then (apply 'combinatorial tail)))
FUNCTION will be called 15 times." (mapcar 'list head)))
(if seqrest
(mapcar
(lambda (x)
(apply
'mapthread
`(lambda (&rest y) (apply ',function x y))
seqrest))
seq1)
(mapcar function seq1)))
(defun indian--puthash-char (char trans-char hashtbls) (defun indian--puthash-char (char trans-char hashtbls)
(let ((encode-hash (car hashtbls)) ;; char -> trans (let ((encode-hash (car hashtbls)) ;; char -> trans
...@@ -446,8 +437,8 @@ FUNCTION will be called 15 times." ...@@ -446,8 +437,8 @@ FUNCTION will be called 15 times."
(if (stringp trans-v) (setq trans-v (list trans-v))) (if (stringp trans-v) (setq trans-v (list trans-v)))
(indian--puthash-char (indian--puthash-char
(concat c v) (concat c v)
(apply 'append (mapcar (lambda (x) (apply 'concat x))
(mapthread 'concat trans-c trans-v)) (combinatorial trans-c trans-v))
hashtbls))) hashtbls)))
v trans-v)) v trans-v))
c trans-c)) c trans-c))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment