• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            糯米

            TI DaVinci, gstreamer, ffmpeg
            隨筆 - 167, 文章 - 0, 評論 - 47, 引用 - 0
            數據加載中……

            lisp MAPC, MAPCAR, MAPCAN, MAPL, MAPLIST, MAPCON

            mapc function &rest lists+ => list-1

            mapcar function &rest lists+ => result-list

            mapcan function &rest lists+ => concatenated-results

            mapl function &rest lists+ => list-1

            maplist function &rest lists+ => result-list

            mapcon function &rest lists+ => concatenated-results

            mapcar operates on successive elements of the listsfunction is applied to the first element of each list, then to the second element of each list, and so on. The iteration terminates when the shortest list runs out, and excess elements in other lists are ignored. The value returned by mapcar is a list of the results of successive calls to function.

            mapcar 首先將函數apply到每個列表的第一個元素,再將函數apply到每個列表的第二個元素。。
            一直到最短的列表的最后一個元素。剩下的元素將被忽略。
            它的結果是返回值不為nil的集合。

            mapc is like mapcar except that the results of applying function are not accumulated. The list argument is returned.

            mapc 和 mapcar 類似。不過返回的是第一個列表。

            maplist is like mapcar except that function is applied to successive sublists of the listsfunction is first applied to the lists themselves, and then to the cdr of each list, and then to the cdr of the cdr of each list, and so on.

            maplist 和 mapcar 類似,不過首先將函數apply到每個列表,然后將函數apply到每個列表的cdr,然后將函數apply到每個列表的cddr。。
            直到最短的一個列表為空為止。

            mapl is like maplist except that the results of applying function are not accumulated; list-1 is returned.

            mapl和maplist類似,但是返回的是第一個列表。

            mapcan and mapcon are like mapcar and maplist respectively, except that the results of applying function are combined into a list by the use of nconc rather than list. That is,

            mapcan 和 mapcon 類似于 mapcar 和 maplist。它們使用 nconc 連接結果而不是 list。
            Examples
            (mapcar #'car '((1 a) (2 b) (3 c))) =>  (1 2 3)   
            (mapcar #'abs '(3 -4 2 -5 -6)) => (3 4 2 5 6)
            (mapcar #'cons '(a b c) '(1 2 3)) => ((A . 1) (B . 2) (C . 3))

            (maplist #'append '(1 2 3 4) '(1 2) '(1 2 3))  =>  ((1 2 3 4 1 2 1 2 3) (2 3 4 2 2 3)) 
            (maplist #'(lambda (x) (cons 'foo x)) '(a b c d)) => ((FOO A B C D) (FOO B C D) (FOO C D) (FOO D))
            (maplist #'(lambda (x) (if (member (car x) (cdr x)) 0 1)) '(a b a c d b c)) => (0 0 1 0 1 1 1)
            (setq dummy nil) =>  NIL   
            (mapc #'(lambda (&rest x) (setq dummy (append dummy x)))
            '(1 2 3 4)
            '(a b c d e)
            '(x y z)) => (1 2 3 4)
            dummy => (1 A X 2 B Y 3 C Z)

            (setq dummy nil) =>  NIL   
            (mapl #'(lambda (x) (push x dummy)) '(1 2 3 4)) => (1 2 3 4)
            dummy => ((4) (3 4) (2 3 4) (1 2 3 4))

            (mapcan #'(lambda (x y) (if (null x) nil (list x y)))
            '(nil nil nil d e)
            '(1 2 3 4 5 6)) => (D 4 E 5)
            (mapcan #'(lambda (x) (and (numberp x) (list x)))
            '(a 1 b c 3 4 d 5)) => (1 3 4 5)

            (mapcon #'list '(1 2 3 4)) =>  ((1 2 3 4) (2 3 4) (3 4) (4))  



             

            posted on 2011-08-19 21:44 糯米 閱讀(811) 評論(0)  編輯 收藏 引用 所屬分類: Lisp

            久久午夜综合久久| 久久99国产乱子伦精品免费| 国产视频久久| 亚洲v国产v天堂a无码久久| 亚洲欧洲精品成人久久奇米网| 亚洲综合日韩久久成人AV| 精品蜜臀久久久久99网站| 久久精品一区二区影院| 亚洲国产另类久久久精品小说| 精品久久777| 伊人久久大香线蕉综合Av| 婷婷综合久久中文字幕| 亚洲综合熟女久久久30p| 久久乐国产精品亚洲综合| 欧美丰满熟妇BBB久久久| 久久久久国产一区二区| av国内精品久久久久影院| 久久亚洲国产精品成人AV秋霞| 久久99国产亚洲高清观看首页| 久久久SS麻豆欧美国产日韩| 亚洲国产天堂久久综合网站| 亚洲中文字幕无码久久综合网| 日韩电影久久久被窝网| 亚洲国产精品久久66| 久久w5ww成w人免费| 99精品国产免费久久久久久下载| 亚洲嫩草影院久久精品| 久久97精品久久久久久久不卡| 无码人妻少妇久久中文字幕蜜桃 | 久久亚洲国产精品成人AV秋霞| 99re久久精品国产首页2020| 久久夜色精品国产噜噜噜亚洲AV| 伊人久久国产免费观看视频| 久久国产成人| 久久男人中文字幕资源站| 久久久久国产精品麻豆AR影院| 国产精品熟女福利久久AV| 99久久精品免费看国产一区二区三区 | 久久中文字幕精品| 欧美国产精品久久高清| 亚洲精品无码久久毛片 |