了解Scheme宏的来源:define-syntax和syntax-rules。 Scheme是一种编程语言,它的宏系统是基于define-syntax和syntax-rules的。在Scheme中,宏是一种特殊的语法形式,它允许用户扩展语言的语法。宏可以用来定义新的语法形式,或者用来修改已有的语法形式。 define-syntax是定义宏的基本方法,它接受两个参数:宏的名称和...
对于syntax-rules(),The Scheme Programming Language上面是这样描述的:While it ismuchless expressive than syntax-case, it is sufficient for defining many common syntactic extension。也就是说,它的表达能力是远弱于 syntax-case 的。syntax-case 在 r6rs 是标准实现所要求的,但是在 r7rs small 中被废除了,...
Delayed evaluation allows the implementation of asynchronous programming techniques such as promises and futures. Hygenic macros— a macro system that allows the programmer to extend the functionality of the language without interfering with the language's native syntax. The ability to natively evaluate ...
SyntaxModelsComputer programmingThe paper discusses how to classify declarative programming languages, includingfunctional logic ones, on the basis of declarative semantics. Four base paradigms are identified. Each stands for an uncombined language approach, such as Horn logic programming. Other declarative ...
Generics without all that syntax 泛型编程不需要关心很多语法,比如类型在 java, c, c++ 中等等。 Generating code is easy 相对其他编程语言生成代码相对简单很多 Metaprogramming is just ... programming 元编程在 Scheme 中与正常编程无异 Macros are (almost) just more code 宏是一种元编程,在 Scheme 中只...
Section 3.1. Syntactic Extension Section 3.2. More Recursion Section 3.3. Continuations Section 3.4. Continuation Passing Style Section 3.5. Internal Definitions Section 3.6. Libraries References Answers to Selected Exercises Formal Syntax Summary of Forms ...
the Scheme Programming Language上面写到:call/cc 可以用来实现非本地退出(nonlocal exits),回溯(backtracking),协程(coroutines)和多任务(multitasking)。它还可以配合宏来创造新的控制结构,比如 return 语句之类的东西。 3.1.nonlocal exits scheme 标准库中有一个 member 过程,它接收一个元素和一个列表,判断元素...
support a variety of programming styles Functional, object-oriented, and imperative Significant Language Features Supports lexical scoping, uniform evaluation rules, and uniform treatment of data types Does not support the concept of a pointer,
by writing transformation procedures that determine how each new syntactic form maps to existing syntactic forms. These transformation procedures are themselves expressed in Scheme with the help of a convenient high-level pattern language that automates syntax checking, input deconstruction, and output rec...
符号类型又称引用类型,在概要一文中本人介绍得非常的模糊,使很多初学者不理解。符号类型在Scheme语言中是最基础也是最重要的一种类型,这是因为Scheme语言的祖先Lisp语言的最初目的就是符号处理,在Scheme语言中几乎所有的东西都可以看做是符号或做为符号列表来处理,这也是我们把符号类型做为第一个问题研究的原因。