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

            評論

            # re: lisp let,let*  回復(fù)  更多評論   

            寫的很詳細(xì),有點(diǎn)理解了。原來 let* 會把上一個表達(dá)式的計(jì)算結(jié)果帶到下一個計(jì)算結(jié)果上面去:)
            2015-10-24 19:58 | creamidea
            国产精品久久久久…| .精品久久久麻豆国产精品| 国产成人久久777777| 久久久久99这里有精品10 | 亚洲天堂久久精品| 少妇久久久久久被弄到高潮 | 伊人久久大香线蕉精品不卡| 狠狠色丁香久久婷婷综合五月 | 精品久久久久久久中文字幕| 久久天天躁狠狠躁夜夜不卡| 国产高清国内精品福利99久久| 少妇精品久久久一区二区三区| 观看 国产综合久久久久鬼色 欧美 亚洲 一区二区| 久久久国产精品| 久久国产热这里只有精品| 91精品国产高清久久久久久国产嫩草 | 久久综合狠狠综合久久综合88| 久久九九久精品国产免费直播| 777米奇久久最新地址| 99久久精品毛片免费播放| av无码久久久久不卡免费网站 | 国产成人久久精品激情| 一本色道久久综合亚洲精品| 少妇无套内谢久久久久| 久久香综合精品久久伊人| 久久99国产乱子伦精品免费| 久久亚洲国产精品一区二区| 伊人热人久久中文字幕| 久久丫精品国产亚洲av| 国产精品熟女福利久久AV| 伊人久久精品无码二区麻豆| 99久久国产综合精品网成人影院 | 亚洲国产欧洲综合997久久| 精品国产乱码久久久久久郑州公司 | 99久久免费国产精品| 色综合久久久久综合体桃花网| 9191精品国产免费久久| 久久精品亚洲日本波多野结衣| 国内精品免费久久影院| 丰满少妇高潮惨叫久久久| 久久精品国产乱子伦|