Emacs-Lisp > mapcar

「Emacs-Lisp/mapcar」の編集履歴(バックアップ)一覧はこちら

Emacs-Lisp/mapcar - (2009/05/31 (日) 11:41:59) の最新版との変更点

追加された行は緑色になります。

削除された行は赤色になります。

*概要 - Function: mapcar FUNCTION SEQUENCE `mapcar'は、SEQUENCEの各要素に順にFUNCTIONを適用し、結果のリストを返す。 引数SEQUENCEは文字テーブル以外の任意の種類のシーケンスでよい。つま り、リスト、ベクトル、ブールベクトル、あるいは、文字列である。結果 はつねにリストである。結果の長さはSEQUENCEの長さと同じである。 たとえば、つぎのとおり。 (mapcar 'car '((a b) (c d) (e f))) => (a c e) (mapcar '1+ [1 2 3]) => (2 3 4) (mapcar 'char-to-string "abc") => ("a" "b" "c") ;; `my-hooks'の各関数を呼び出す (mapcar 'funcall my-hooks) (defun mapcar* (function &rest args) "Apply FUNCTION to successive cars of all ARGS. Return the list of results." ;; リストをつくしていなければ (if (not (memq 'nil args)) ;; CARに関数を適用する (cons (apply function (mapcar 'car args)) (apply 'mapcar* function ;; Recurse for rest of elements. (mapcar 'cdr args))))) (mapcar* 'cons '(a b c) '(1 2 3 4)) => ((a . 1) (b . 2) (c . 3)) *呼出元 - [[grass.el(0.1.8)/defun grass-parse-normalize]] #comment(noname) *履歴 -作者:[[kobapan>http://www20.atwiki.jp/kobapan/]] -日付:2009/01/03 -対象: |更新日|更新者|更新内容| |||| *コメント #comment
*概要 - Function: mapcar FUNCTION SEQUENCE `mapcar'は、SEQUENCEの各要素に順にFUNCTIONを適用し、結果のリストを返す。 引数SEQUENCEは文字テーブル以外の任意の種類のシーケンスでよい。つま り、リスト、ベクトル、ブールベクトル、あるいは、文字列である。結果 はつねにリストである。結果の長さはSEQUENCEの長さと同じである。 たとえば、つぎのとおり。 (mapcar 'car '((a b) (c d) (e f))) => (a c e) (mapcar '1+ [1 2 3]) => (2 3 4) (mapcar 'char-to-string "abc") => ("a" "b" "c") ;; `my-hooks'の各関数を呼び出す (mapcar 'funcall my-hooks) (defun mapcar* (function &rest args) "Apply FUNCTION to successive cars of all ARGS. Return the list of results." ;; リストをつくしていなければ (if (not (memq 'nil args)) ;; CARに関数を適用する (cons (apply function (mapcar 'car args)) (apply 'mapcar* function ;; Recurse for rest of elements. (mapcar 'cdr args))))) (mapcar* 'cons '(a b c) '(1 2 3 4)) => ((a . 1) (b . 2) (c . 3)) *呼出元 - [[grass.el(0.1.8)/defun grass-parse-normalize]] #comment(noname) *履歴 -作者:[[kobapan>http://www20.atwiki.jp/kobapan/]] -日付:2009/01/03 -対象: |更新日|更新者|更新内容| |||| *コメント #comment

表示オプション

横に並べて表示:
変化行の前後のみ表示: