• <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 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 糯米 閱讀(809) 評論(1)  編輯 收藏 引用 所屬分類: Lisp

            評論

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

            寫的很詳細,有點理解了。原來 let* 會把上一個表達式的計算結果帶到下一個計算結果上面去:)
            2015-10-24 19:58 | creamidea
            久久精品国内一区二区三区| 区亚洲欧美一级久久精品亚洲精品成人网久久久久 | 久久久久久亚洲精品无码| 久久精品国产欧美日韩| 久久99热这里只有精品66| 国产精品免费福利久久| 久久国产福利免费| 久久精品人人做人人妻人人玩| 99久久精品久久久久久清纯| 亚洲国产成人久久综合一区77| 99久久99久久精品国产片果冻| 99久久777色| 久久精品一区二区三区AV| 99久久免费国产精品| 老男人久久青草av高清| 91精品日韩人妻无码久久不卡| 亚洲国产美女精品久久久久∴| 丰满少妇人妻久久久久久4| 伊人久久综合精品无码AV专区| 久久久国产精品| 亚洲伊人久久大香线蕉苏妲己| 亚洲午夜久久久影院| 亚洲人AV永久一区二区三区久久| 99精品伊人久久久大香线蕉| 99热成人精品热久久669| 成人久久免费网站| 精品久久久久久久久免费影院| 久久精品夜色噜噜亚洲A∨| 久久久九九有精品国产| 久久精品国产99久久久| 色综合久久中文字幕无码| 97精品依人久久久大香线蕉97| 怡红院日本一道日本久久| 久久精品午夜一区二区福利| 亚洲va久久久噜噜噜久久| 久久久久久精品免费看SSS| 久久精品国产精品亚洲精品| 一本一本久久aa综合精品| 久久99国产综合精品女同| 久久精品国产亚洲AV无码偷窥| 久久精品国产99久久久|