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都 ...
随机推荐
- Android高德地图开发具体解释
这段时间开发的时候用到了高德地图,对高德地图开发有心得体会,如今分享给大家.对我开发过百度地图的我来说,整体来说高德地图Demo,没有百度解说的具体 个人更偏向于使用百度地图,可是没办发,项目须要使用 ...
- sh里没有多行注释,只能每一行加一个#号
sh里没有多行注释,只能每一行加一个#号.只能像这样: #-------------------------------------------- # 这是一个自动打ipa的脚本,基于webfrogs ...
- JavaEE Tutorials (28) - Duke书店案例研究示例
28.1Duke书店的设计和架构43828.2Duke书店接口439 28.2.1Book Java持久化API实体439 28.2.2Duke书店中使用的企业bean440 28.2.3Duke书店 ...
- 【DP问题集】动态规划试题
1.背包问题 给定n种物品和一背包.物品i的重量是wi,其价值为pi,背包的容量为C.问应如何选择装入背包的物品,使得装入背包中物品的总价值最大? 分析: ①每个物品只有两种选择,要么就是塞到包里面, ...
- 解决ssh无密码登录不成功的问题
把ssh设置为无密码登录很简单,只需两步: 1.在本地创建公钥和私钥: ssh-keygen -t rsa 2.然后把公钥上传到远程机器上: ssh-copy-id -i ~/.ssh/id_rsa. ...
- Linux —— Shell编程之变量赋值和引用
Linux的shell编程是一种非常成熟的编程语言,它支持各种类型的变量.有三种主要的变量类型:环境变量.内部变量和用户变量. 环境变量(environment variable)是系统环境的一部分, ...
- IT人士的职业规范——凝视
这两天将系统敲完了,该总体调试了,调试的过程中,发现了一个非常大的问题,就是自己的凝视写的不够,有时候不明确U层这个事件是做什么的,有时候不知道这个事件传递的是什么參数,有时候不知道相应的B层和 ...
- Linux 下mysql修改数据库存放目录方法和可能遇到的问题
MySQL版本:5.6.23-enterprise-commercial-advanced ,使用rpm安装linux:Red Hat Enterprise Linux Server release ...
- Windows Live Writer针对CNBLOG的代码高亮插件
一,CodeHighlighter 1. 下载插件 下载地址:http://files.cnblogs.com/files/cmt/WindowsLiveWriter.CNBlogs.CodeHigh ...
- linux下Mysql 的安装、配置、数据导入导出
MySQL是一种开放源代码的关系型数据库管理系统(RDBMS),虽然功能未必很强大,但因它的免费开源而广受欢迎. 这次,接着上一篇<CentOs minimal安装和开发环境部署>,讲下L ...