let区别(关于racket和r5rs)
R5RS is the Revised5 Report on the Algorithmic Language Scheme.参考http://www.schemers.org/Documents/Standards/R5RS/。
racket let 用法:
Examples: |
||||||||
|
The second form evaluates the init-exprs; the resulting values become arguments in an application of a procedure (lambda (id ...) body ...+), where proc-id is bound within the bodys to the procedure itself.
Example: |
||||||
|
Example: |
|||||
|
r5rs:
Syntax: <Bindings> should have the form ((<variable1> <init1>) ...),
where each <init> is an expression, and <body> should be a sequence of one or more expressions. It is an error for a <variable> to appear more than once in the list of variables being bound.
Semantics: The <init>s are evaluated in the current environment (in some unspecified order), the <variable>s are bound to fresh locations holding the results, the <body> is evaluated in the extended environment, and the value(s) of the last expression of <body> is(are) returned. Each binding of a <variable> has <body> as its region.
(let ((x 2) (y 3))
(* x y)) ===> 6
(let ((x 2) (y 3))
(let ((x 7)
(z (+ x y)))
(* z x))) ===> 35
See also named let, section 4.2.4.
Syntax: <Bindings> should have the form ((<variable1> <init1>) ...),
and <body> should be a sequence of one or more expressions.
Semantics: Let* is similar to let, but the bindings are performed sequentially from left to right, and the region of a binding indicated by(<variable> <init>) is that part of the let* expression to the right of the binding. Thus the second binding is done in an environment in which the first binding is visible, and so on.
(let ((x 2) (y 3))
(let* ((x 7)
(z (+ x y)))
(* z x))) ===> 70
let区别(关于racket和r5rs)的更多相关文章
- racket
let 和 let* 区别 ``` racket // 这是对的 (let* ([x (random 4)][o (random 4)] [diff (number->string (abs ( ...
- Scheme r5rs letrec的用法
说明,这是r5rs的用法. (letrec ((<variable> <init>) ...) <body>) 假设((<variable> <i ...
- racket学习-call/cc (let/cc)
Drracket continuation 文中使用let/cc代替call/cc Racket文档中,let/cc说明为: (let/cc k body ...+) Equivalent to (c ...
- c#与java的区别
经常有人问这种问题,用了些时间java之后,发现这俩玩意除了一小部分壳子长的还有能稍微凑合上,基本上没什么相似之处,可以说也就是马甲层面上的相似吧,还是比较短的马甲... 一般C#多用于业务系统的开发 ...
- jquery和Js的区别和基础操作
jqery的语法和js的语法一样,算是把js升级了一下,这两种语法可以一起使用,只不过是用jqery更加方便 一个页面想要使用jqery的话,先要引入一下jqery包,jqery包从网上下一个就可以, ...
- 【原】nodejs全局安装和本地安装的区别
来微信支付有2年多了,从2年前的互联网模式转变为O2O模式,主要的场景是跟线下的商户去打交道,不像以往的互联网模式,有产品经理提需求,我们帮忙去解决问题. 转型后是这样的,团队成员更多需要去寻找业务的 ...
- 探究@property申明对象属性时copy与strong的区别
一.问题来源 一直没有搞清楚NSString.NSArray.NSDictionary--属性描述关键字copy和strong的区别,看别人的项目中属性定义有的用copy,有的用strong.自己在开 ...
- X86和X86_64和X64有什么区别?
x86是指intel的开发的一种32位指令集,从386开始时代开始的,一直沿用至今,是一种cisc指令集,所有intel早期的cpu,amd早期的cpu都支持这种指令集,ntel官方文档里面称为&qu ...
- Java中Comparable与Comparator的区别
相同 Comparable和Comparator都是用来实现对象的比较.排序 要想对象比较.排序,都需要实现Comparable或Comparator接口 Comparable和Comparator都 ...
随机推荐
- gcc的stdcall扩展
MSVC上: 如果是函数调用约定直接就写 __stdcall 之类的就行了 如果是gcc上: 函数的扩展调用约定要这样写 __attribute__((__stdcall__)),默认为__attri ...
- curl 浏览器模拟请求实战
1,curl 常用选项
- 自定义View的封装
通过上一个博文的自定义View的编写后,发现代码其实挺复杂的,所有这里通过对代码进一步的优化,即用到了java的一个重要的特点:封装.通过对父类的方法进行封装,然后在子类继承后实现相应的函数即可,达到 ...
- Restful风格的springMVC配搭ajax请求的小例子
1. GET请求的例子 ajax代码: 请求参数拼接在url后面(参数在服务器可通过HttpServletRequest获取,也可以直接通过@RequestParam自动注入,参考DELETE例子的方 ...
- Android学习总结——系统提示对话框(AlertDialog)
new AlertDialog.Builder(MainActivity.this).setTitle("退出")//设置对话框标题 .setMessage("官人可是要 ...
- HBase--DependentColumnFilter(参考例过滤器 )详解
DependentColumnFilter是一种允许用户指定一个参考列或引用列来过滤其他列的过滤器,过滤的原则是基于参考列的时间戳来进行筛选 . 官方说明: 大意:此过滤器提供两个参数--列族和列限定 ...
- [每日一题] OCP1z0-047 :2013-08-18 禁用启用约束――主键与外键 ..................................61
正确答案:C 根据题意,测试结果如下: 1.创建表emp,并且设emp_no字段为主键,设mgr_no字段为外键. gyj@MYDB> create table emp 2 (emp_no nu ...
- with ffmpeg to encode video for live streaming and for recording to files for on-demand playback
We've been doing some experimentation with ffmpeg to encode video for live streaming and for recordi ...
- 什么是目标、度量、KPI、维度和细分
今天看到了Avinash的一篇文章:Web Analytics 101: Definitions: Goals, Metrics, KPIs, Dimensions, Targets,正是我想在影响网 ...
- 实现android4.4新特性:沉浸式状态栏
先放效果图: 所谓沉浸式状态栏,就是android4.4以后新加入的ui效果,能使最顶部的状态栏自动适宜app顶部的颜色,使两者看起来更像融为一体.下面放上实现代码: requestWindowFea ...