Difference between LET and LET* in Common LISP
 
LET
 
Parallel binding which means the bindings come to life at the same time and they do not shadow each other. The values are effective inside LET and they are undefined outside LET. Just like local variables.
 
LET binds variables all at the same time.
 
None of the variables defined in the LET have a value after lisp has finished evaluating the form.
 
Example 1:
 
Input:
* (setf x 'outside)
* (let ((x 'inside)
        (y x))
        (list x y))
 
Output:
(INSIDE OUTSIDE)
 
Example 2:
 
Input:
(let ((a 3)
      (b 4)
      (c 5))
     (* (+ a b)c))
 
Output:
35
 
Example 3:
 
Input:
(setq a 10)
(let ((a 3)
      (m a))
     (+m a))
 
Output:
13
 
 
 
 
LET*
 
Sequential binding.
 
Example:
 
Input:
* (setf x 'outside)
* (let* ((x 'inside)
         (y x))
         (list x y))
 
Output:
(INSIDE INSIDE)
 
 
 
It always more efficient to use LET than LET*. Since the program can run parallel when using LET.

Difference between LET and LET* in Common LISP的更多相关文章

  1. ANSI Common Lisp Practice - My Answers - Chatper - 3

    Ok, Go ahead. 1 (a) (b) (c) (d) 2 注:union 在 Common Lisp 中的作用就是求两个集合的并集.但是这有一个前提,即给的两个列表已经满足集合的属性了.具体 ...

  2. 搭建fedora开发环境 common lisp, c++, go

    第三方软件库: http://download1.rpmfusion.org/free/fedora/releases/25/Everything/x86_64/os/repoview/index.h ...

  3. Common Lisp编译程序的小技巧

    这几天开始玩Common Lisp,遇上了一个有意思的问题,CL一般是解释运行,也有实现可以编译生成字节码(fas文件).我正在用的两种CL实现是SBCL和CLISP,前者是我从<实用Commo ...

  4. scheme和common lisp 区别

    Scheme and Common Lisp use different names for some of the basic system functions. Many Lisp program ...

  5. slime+sbcl for common lisp

    sudo apt-get install slime audo apt-get install sbcl ;;sbcl+slime for common lisp ;;sudo apt-get ins ...

  6. Common Lisp 编译器IDE环境搭建

    搭建Common Lisp编程环境的方法有很多种,这里我使用的是最常见的一种:SBCL + Emacs + SLIME. SBCL是Steel Bank Common Lisp的简称,它是Common ...

  7. 推动Common Lisp的实际应用

    推动Common Lisp的实际应用 推动Common Lisp的实际应用

  8. Common Lisp第三方库介绍 | (R "think-of-lisper" 'Albertlee)

    Common Lisp第三方库介绍 | (R "think-of-lisper" 'Albertlee) Common Lisp第三方库介绍 一个丰富且高质量的开发库集合,对于实际 ...

  9. Lisp: Common Lisp, Racket, Clojure, Emacs Lisp - Hyperpolyglot

    Lisp: Common Lisp, Racket, Clojure, Emacs Lisp - Hyperpolyglot Lisp: Common Lisp, Racket, Clojure, E ...

随机推荐

  1. 用PhpStorm IDE创建GG App Engine PHP应用教程

    在上一篇教程里我们已经介绍了如何为PhpStorm搭建软件环境,那么今天就该是正式的开始创建App了: 3.创建首个Google App Engine PHP Application 现在我们就可以开 ...

  2. SP_APPROVALSET_OVERTIME 插入單據

    CREATE OR REPLACE PROCEDURE SP_APPROVALSET_OVERTIME(VAPPLY_NO varchar2,VAPPLYKIND_NO varchar2,VFAC_N ...

  3. URAL 1915 Titan Ruins: Reconstruction of Bygones(思路)

    搞这个题差不多是从比赛开始到结束. 从自信慢慢的看题一直到wrong到死. 这个题目可以说成是思路题,以为我们只要明白一点,这道题就成了纯暴力的水题, 那就是当操作数不足栈中数字数目的时候,我们就没有 ...

  4. JAVA的初始化顺序(续)

    JAVA在创建对象之前,是先加载类,然后再创建对象. 加载类时,会加载静态的成员变量,包括父类的静态成员变量[先加载父类,再加载子类]. 一.  静态成员变量的初始化 package com.cnbl ...

  5. Android 5.x特性概览五

    上节,介绍Material Design 对阴影效果的实现,这节,我们来介绍Android 5.x的着色与裁剪的特性. Android 5.X 在对图像的操作上增加更多的功能,下面来看看 Androi ...

  6. C#设计模式(7)——适配器模式(Adapter Pattern)

    一.引言 在实际的开发过程中,由于应用环境的变化(例如使用语言的变化),我们需要的实现在新的环境中没有现存对象可以满足,但是其他环境却存在这样现存的对象.那么如果将“将现存的对象”在新的环境中进行调用 ...

  7. 简单SQL分页

    Select * From (     Select     Row_Number() Over(Order By 表1.CreateTime desc) as rowId,     表1.Alumn ...

  8. ueditor样式过滤问题

    1.4.3版本样式过滤处理如下: if (domUtils.isEmptyNode(me.body)) {    //alert("xx");    //me.body.inner ...

  9. CSS扇形展开效果

    知识点预备: [1]CSS3中特别重要的transform中的rotate(),现在transform可以将元素进行2D和3D变形. 2D transform常用的transform-function ...

  10. ruby正则匹配回车换行符

    如果你使用/^.*$/这种正则是匹配不到回车换行符的. 所以应该像下面这么写: /^[\s\S]*$/