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

            評論

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

            寫的很詳細,有點理解了。原來 let* 會把上一個表達式的計算結果帶到下一個計算結果上面去:)
            2015-10-24 19:58 | creamidea
            久久久精品国产免大香伊 | 久久国产成人| 99精品伊人久久久大香线蕉| 亚洲国产精品久久久久| 久久国产精品视频| 国产精品久久久久久久久软件| 亚洲国产精品高清久久久| 99久久国产综合精品五月天喷水| 人妻中文久久久久| 成人免费网站久久久| 久久久久se色偷偷亚洲精品av| 国产精品青草久久久久婷婷| 人妻精品久久久久中文字幕| 久久最近最新中文字幕大全| 久久精品国产乱子伦| 久久97久久97精品免视看秋霞| 无码伊人66久久大杳蕉网站谷歌| 久久九九久精品国产| 久久ww精品w免费人成| 久久亚洲国产精品成人AV秋霞| 国产精品美女久久久久av爽| 久久超碰97人人做人人爱| 久久无码高潮喷水| 亚洲欧洲中文日韩久久AV乱码| 欧美亚洲另类久久综合| 亚洲精品无码久久久久sm| 亚洲国产日韩综合久久精品| 99热热久久这里只有精品68| 久久亚洲欧美日本精品| 91精品国产高清91久久久久久 | AV无码久久久久不卡蜜桃| 思思久久99热免费精品6| 久久中文精品无码中文字幕| 国产精品日韩深夜福利久久| 狠狠精品久久久无码中文字幕 | 久久久综合九色合综国产| 亚洲国产另类久久久精品黑人 | 国产99久久久久久免费看 | 久久国产午夜精品一区二区三区| 国产精品久久久久影视不卡| 成人国内精品久久久久一区|