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

            評論

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

            寫的很詳細,有點理解了。原來 let* 會把上一個表達式的計算結果帶到下一個計算結果上面去:)
            2015-10-24 19:58 | creamidea
            99久久99久久精品免费看蜜桃| 久久99久久无码毛片一区二区| 污污内射久久一区二区欧美日韩| 久久久久亚洲精品男人的天堂| 久久久久亚洲AV综合波多野结衣| 亚洲熟妇无码另类久久久| 国产美女亚洲精品久久久综合| 精品免费tv久久久久久久| 三级片免费观看久久| 97久久超碰国产精品旧版| 亚洲国产成人久久一区WWW| 国产一久久香蕉国产线看观看| 亚洲欧洲精品成人久久曰影片| 久久精品草草草| 97久久国产露脸精品国产| 九九久久精品国产| 91精品国产综合久久精品| 久久精品国产免费观看| 天天综合久久久网| AAA级久久久精品无码片| 99蜜桃臀久久久欧美精品网站| 中文字幕亚洲综合久久| 久久综合亚洲欧美成人| 久久精品极品盛宴观看| 久久精品18| 精品久久人人爽天天玩人人妻 | 青青青青久久精品国产h| 久久久精品2019免费观看| 香蕉久久夜色精品升级完成| 精品综合久久久久久97| 久久热这里只有精品在线观看| 亚洲国产成人久久综合碰| 久久精品亚洲欧美日韩久久| 大蕉久久伊人中文字幕| 9191精品国产免费久久| 久久本道伊人久久| 51久久夜色精品国产| 国产精品va久久久久久久| 99久久精品国产毛片| 久久涩综合| 久久精品国产亚洲αv忘忧草|