没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
MIT/GNU Scheme User’s Manual
Edition 1.93 for MIT/GNU Scheme 9.0
2010-02-18
by Stephen Adams
Chris Hanson
and the MIT Scheme Team
This manual documents the use of MIT/GNU Scheme 9.0.
Copyright
c
1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Massachusetts
Institute of Technology
Permission is granted to copy, distribute and/or modify this document under
the terms of the GNU Free Documentation License, Version 1.2 or any later
version published by the Free Software Foundation; with no Invariant Sections,
with the Front-Cover Texts being “A GNU Manual,” and with the Back-Cover
Texts as in (a) below. A copy of the license is included in the section entitled
“GNU Free Documentation License.”
(a) The FSF’s Back-Cover Text is: “You have freedom to copy and modify
this GNU Manual, like GNU software. Copies published by the Free Software
Foundation raise funds for GNU development.”
i
Table of Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 Unix Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Windows Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Running Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1 Basics of Starting Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Customizing Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Memory Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.4 Command-Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.5 Custom Command-line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.6 Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.6.1 Environment Variables for the Microcode . . . . . . . . . . . . . . . . . 10
2.6.2 Environment Variables for the Runtime System . . . . . . . . . . . 11
2.6.3 Environment Variables for Edwin . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.6.4 Environment Variables for Microsoft Windows . . . . . . . . . . . . 12
2.7 Starting Scheme from Microsoft Windows . . . . . . . . . . . . . . . . . . . . . 13
2.8 Leaving Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3 Using Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1 The Read-Eval-Print Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.1 The Prompt and Level Number. . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.2 Interrupting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.1.3 Restarting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.1.4 The Current REPL Environment . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2 Loading Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3 World Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.4 Garbage Collection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4 Compiling Programs . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.1 Compilation Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.2 Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.2.1 Standard Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.2.2 In-line Coding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.2.3 Operator Replacement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.2.4 Operator Reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.3 Efficiency Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.3.1 Coding style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.3.2 Global variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.3.3 Fixnum arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.3.4 Flonum arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
ii MIT/GNU Scheme 9.0
5 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.1 Subproblems and Reductions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.2 The Command-Line Debugger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.3 Debugging Aids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.4 Advising Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6 GNU Emacs Interface . . . . . . . . . . . . . . . . . . . . . . . . . 49
7 Edwin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
7.1 Starting Edwin. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
7.2 Leaving Edwin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
7.3 Scheme Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
7.4 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
7.5 REPL Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
7.6 The Edwin Debugger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
7.7 Last Resorts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Appendix A Release Notes . . . . . . . . . . . . . . . . . . . . . 57
Appendix B GNU Free Documentation License
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
B.1 ADDENDUM: How to use this License for your documents . . . . 65
Appendix C Environment-variable Index . . . . . 67
Appendix D Option Index. . . . . . . . . . . . . . . . . . . . . . 69
Appendix E Variable Index . . . . . . . . . . . . . . . . . . . . 71
Appendix F Concept Index . . . . . . . . . . . . . . . . . . . . 73
Introduction 1
Introduction
This document describes how to install and use MIT/GNU Scheme, the UnCommon Lisp. It
gives installation instructions for all of the platforms that we support; complete documen-
tation of the command-line options and environment variables that control how Scheme
works; and rudimentary descriptions of how to interact with the evaluator, compile and
debug programs, and use the editor. The release notes are included as an appendix.
This document discusses many operating-system specific features of the MIT/GNU
Scheme implementation. In order to simplify the discussion, we use abbreviations to re-
fer to some operating systems. When the text uses the term unix, this means any of the
unix systems that we support, including GNU/Linux and the BSD variants. We use the
term Windows to collectively refer to the modern Microsoft Windows 32-bit operating sys-
tems: Windows NT, Windows 2000, and Windows XP. We use the term PC to refer to
any computer running Windows. Thus we consider a PC to be a system with a DOS-like
file system, using backslashes for directory separators, drive letters, cr-lf line termination,
and (potentially) the hideous 8.3 short filenames.
The primary distribution site for this software is
http://www.gnu.org/mit-scheme/
Although our software is distributed from other sites and in other media, the complete
distribution and the most recent release is always available at our site.
To report bugs, use the bug-reporting tool at
http://savannah.gnu.org/projects/mit-scheme/
Please include the output of the identify-world procedure (see Section 2.1 [Basics of
Starting Scheme], page 5), so we know what version of the system you are using.
剩余77页未读,继续阅读
资源评论
corewolf0
- 粉丝: 0
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功