Scheme 在线教程

 Teach Yourself Scheme in Fixnum Days

 

 

 

 

 ©  Dorai Sitaram, 1998-2004 
 All Rights Reserved 
  ds26 at gte.com 
 Cover art by Margaret Wong 

 



 

 

Contents

    Preface

    1  Enter Scheme

    2  Data types
        2.1  Simple data types
            2.1.1  Booleans
            2.1.2  Numbers
            2.1.3  Characters
            2.1.4  Symbols
        2.2  Compound data types
            2.2.1  Strings
            2.2.2  Vectors
            2.2.3  Dotted pairs and lists
            2.2.4  Conversions between data types
        2.3  Other data types
        2.4  S-expressions

    3  Forms
        3.1  Procedures
            3.1.1  Procedure parameters
            3.1.2  Variable number of arguments
        3.2  apply
        3.3  Sequencing

    4  Conditionals
        4.1  when and unless
        4.2  cond
        4.3  case
        4.4  and and or

    5  Lexical variables
        5.1  let and let*
        5.2  fluid-let

    6  Recursion
        6.1  letrec
        6.2  Named let
        6.3  Iteration
        6.4  Mapping a procedure across a list

    7  I/O
        7.1  Reading
        7.2  Writing
        7.3  File ports
            7.3.1  Automatic opening and closing of file ports
        7.4  String ports
        7.5  Loading files

    8  Macros
        8.1  Specifying the expansion as a template
        8.2  Avoiding variable capture inside macros
        8.3  fluid-let

    9  Structures
        9.1  Default initializations
        9.2  defstruct defined

    10  Alists and tables

    11  System interface
        11.1  Checking for and deleting files
        11.2  Calling operating-system commands
        11.3  Environment variables

    12  Objects and classes
        12.1  A simple object system
        12.2  Classes are instances too
        12.3  Multiple inheritance

    13  Jumps
        13.1  call-with-current-continuation
        13.2  Escaping continuations
        13.3  Tree matching
        13.4  Coroutines
            13.4.1  Tree-matching with coroutines

    14  Nondeterminism
        14.1  Description of amb
        14.2  Implementing amb in Scheme
        14.3  Using amb in Scheme
        14.4  Logic puzzles
            14.4.1  The Kalotan puzzle
            14.4.2  Map coloring

    15  Engines
        15.1  The clock
        15.2  Flat engines
        15.3  Nestable engines

    16  Shell scripts
        16.1  Hello, World!, again
        16.2  Scripts with arguments
        16.3  Example

    17  CGI scripts
        17.1  Example: Displaying environment variables
        17.2  Example: Displaying selected environment variable
        17.3  CGI script utilities
        17.4  A calculator via CGI

    A  Scheme dialects
        A.1  Invocation and init files
        A.2  Shell scripts
        A.3  define-macro
        A.4  load-relative

    B  DOS batch files in Scheme

    C  Numerical techniques
        C.1  Simpson's rule
        C.2  Adaptive interval sizes
        C.3  Improper integrals

    D  A clock for infinity

    E  References

    F  Index

 

 


Index


' (quote)
*
+
, (comma)
,@ (comma-splice)
-
/
<
<=
=
>
>=
` (backquote)

 

 


abs
alist
amb
and
apply
association list, see alist
assv
atan

 

 


#b (binary number)
begin, [2]
    implicit, [2]
Bigloo
boolean
boolean?

 

 


c...r
call-with-current-continuation, see call/cc
call-with-input-file
call-with-output-file
call/cc
    and coroutine
    and engine
car
case
cdr
char->integer
char-ci<=?
char-ci<?
char-ci=?
char-ci>=?
char-ci>?
char-downcase
char-upcase
char<=?
char<?
char=?
char>=?
char>?
char?
character
    #/ notation for
Chicken
class
clock
    Guile
close-input-port
close-output-port
command line
comment
complex?
cond
conditional
cons
console
continuation
coroutine
current-input-port
current-output-port

 

 


#d (decimal number)
data type
    compound
    conversion to and fro
    simple
define
define-macro
    in various dialects
defstruct
delete-duplicates
delete-file
dialects of Scheme
display, [2]
dotted pair

 

 


empty list
engine
    flat
    nestable
eof-object?
eqv?
evaluation
even?
exit
exp
expt

 

 


#f
falsity
file
    checking existence of
    deleting
    loading
    port for
    time of last modification of
file-exists?
file-or-directory-modify-seconds, [2]
fixnum
fluid-let
    macro for
for-each
form

 

 


Gambit
Gauche
gensym
get-output-string
getenv
Guile
    clock

 

 


identifier
if
inheritance
    multiple
    single
init file
instance, see object
integer->char
integer?
iteration

 

 


Kawa

 

 


lambda
let
    named
let*
letrec
list
list (procedure)
list->string
list->vector
list-position
list-ref
list-tail
list?
listener
load, [2]
load-relative
    in various dialects
logic programming
loop

 

 


macro
    avoiding variable capture inside
make-string
make-vector
map
max
metaclass
method, see object
min
MIT Scheme
multiple inheritance
MzScheme, [2]

 

 


named let
newline, [2]
nondeterminism
not
null?
number
number->string
number?
numerical integration

 

 


#o (octal number)
object
object-oriented programming
odd?
open-input-file
open-input-string
open-output-file
open-output-string
or

 

 


pair?
Pocket Scheme
port, [2]
    for file
    for string
procedure, [2]
    parameters
    recursive
    tail-recursive
puzzles

 

 


quote

 

 


R5RS, [2]
rational?
read
read-char
read-eval-print loop
read-line
real?
recursion
    iteration as
    letrec
    tail
reverse!

 

 


S-expression
SCM
script, [2]
    CGI
    DOS
self-evaluation
set!
set-car!
set-cdr!
Simpson's rule
slot, see object
sqrt
standard input
standard output, [2]
STk
string
    port for
string (procedure)
string->list
string->number
string-append
string-ref
string-set!
string?
structure
    defstruct
subclass
subform
superclass
symbol
    case-insensitivity
    generated
symbol?
system

 

 


#t
table
tail call
    elimination of
tail recursion
truth

 

 


unless
    macro for

 

 


variable
    global, [2]
    lexical
    local
vector
vector (procedure)
vector->list

 

 


when
    macro for
write
write-char

 

 


#x (hexadecimal number)

 

 


zen

 

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值