• <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
            數(shù)據(jù)加載中……

            lisp let,let*

            let and let* create new variable bindings and execute a series of forms that use these bindings. 
            let performs the bindings in parallel and let* does them sequentially.

            The form

            (let ((var1 init-form-1)
            (var2 init-form-2)
            ...
            (varm init-form-m))
            declaration1
            declaration2
            ...
            declarationp
            form1
            form2
            ...
            formn)

            first evaluates the expressions init-form-1, init-form-2, and so on, in that order, saving the resulting values.
            Then all of the variables varj are bound to the corresponding values;
            each binding is lexical unless there is a special declaration to the contrary.
            The expressions formk are then evaluated in order; the values of all but the last are discarded
            (that is, the body of a let is an implicit progn).
            let* is similar to let, but the bindings of variables are performed sequentially rather than in parallel.
            The expression for the init-form of a var can refer to vars previously bound in the let*.

            The form

            (let* ((var1 init-form-1)
            (var2 init-form-2)
            ...
            (varm init-form-m))
            declaration1
            declaration2
            ...
            declarationp
            form1
            form2
            ...
            formn)
            first evaluates the expression init-form-1, then binds the variable var1 to that value;
            then it evaluates init-form-2 and binds var2, and so on.
            The expressions formj are then evaluated in order;
            the values of all but the last are discarded (that is, the body of let* is an implicit progn).

            For both let and let*, if there is not an init-form associated with a var, var is initialized to nil.

            The special form let has the property that the scope of the name binding does not include any initial value form.
            For let*, a variable's scope also includes the remaining initial value forms for subsequent variable bindings.


            Examples:

            (setq a 'top) => TOP
            (defun dummy-function () a) => DUMMY-FUNCTION
            (let ((a 'inside) (b a))
            (format nil "~S ~S ~S" a b (dummy-function))) => "INSIDE TOP TOP"
            (let* ((a 'inside) (b a))
            (format nil "~S ~S ~S" a b (dummy-function))) => "INSIDE INSIDE TOP"
            (let ((a 'inside) (b a))
            (declare (special a))
            (format nil "~S ~S ~S" a b (dummy-function))) => "INSIDE TOP INSIDE"

            posted on 2011-08-22 11:50 糯米 閱讀(818) 評論(1)  編輯 收藏 引用 所屬分類: Lisp

            評論

            # re: lisp let,let*  回復  更多評論   

            寫的很詳細,有點理解了。原來 let* 會把上一個表達式的計算結(jié)果帶到下一個計算結(jié)果上面去:)
            2015-10-24 19:58 | creamidea
            欧洲精品久久久av无码电影| 99久久婷婷国产一区二区| 日韩精品久久久久久久电影| 久久无码高潮喷水| 久久精品国产久精国产思思| 久久中文字幕一区二区| 久久久久久国产a免费观看黄色大片| 国产成人精品三上悠亚久久| 1000部精品久久久久久久久| 久久精品综合一区二区三区| 中文精品久久久久人妻不卡| 国产精品女同一区二区久久| 热re99久久6国产精品免费| 精品久久久久久99人妻| 中文字幕热久久久久久久| 国内精品伊人久久久久影院对白 | 97超级碰碰碰碰久久久久| 日本五月天婷久久网站| 国产精品热久久无码av| 久久国产欧美日韩精品| 久久久久亚洲AV无码观看| 久久久久国产日韩精品网站 | 久久久久97国产精华液好用吗| 麻豆成人久久精品二区三区免费| 亚洲伊人久久综合中文成人网| 久久精品国产99久久香蕉| 青草影院天堂男人久久| 国产精品久久久久国产A级| 亚洲精品无码久久久久久| 一本一本久久aa综合精品| 亚洲欧美一区二区三区久久| 久久无码一区二区三区少妇| 久久久91人妻无码精品蜜桃HD| 久久精品免费观看| 久久电影网一区| 大蕉久久伊人中文字幕| 91性高湖久久久久| 国产成人无码精品久久久免费| 国产亚洲美女精品久久久| 久久播电影网| 色婷婷噜噜久久国产精品12p|