对于syntax-rules(),The Scheme Programming Language 上面是这样描述的:While it is much less expressive than syntax-case, it is sufficient for defining many common syntactic extension。也就是说,它的表达能力是远弱于 syntax-case 的。sy
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 ...
Section 1.1. Scheme Syntax Section 1.2. Scheme Naming Conventions Section 1.3. Typographical and Notational Conventions ··· (更多) 原文摘录 ··· During the evaluation of a Scheme expression, the implementation must keep track of two things: (1) what to evaluate and (2) what to do with...
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 ...
Generics without all that syntax 泛型编程不需要关心很多语法,比如类型在 java, c, c++ 中等等。 Generating code is easy 相对其他编程语言生成代码相对简单很多 Metaprogramming is just ... programming 元编程在 Scheme 中与正常编程无异 Macros are (almost) just more code 宏是一种元编程,在 Scheme 中只...
Significant Language Features Scheme has several important advantages It is elegantly simple in that regular structure and trivial syntax avoids "special case" confusion Its expressiveness means that one spends little time trying to work around the language It lets users concentrate on what...
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...
这里的例子来自 the scheme Programming Language,使用 syntax-case 宏定义了一个循环结构: (define-syntax loop (lambda (x) (syntax-case x () [(k e ...) (with-syntax ([break (datum->syntax #'k 'break)]) #'(call/cc (lambda (break) (let f () e ... (f)))]))) 当然,上面的代码...
© 1996 Prentice Hall PTR Prentice Hall, Inc. A Simon and Schuster Company Upper Saddle River, NJ 07458 ISBN: 0-13-454646-6 Library catalog: QA76.73.S34D93
(rnrs syntax-case (6)) (rnrs hashtables (6)) (rnrs enums (6)) (rnrs eval (6)) (rnrs mutable-pairs (6)) (rnrs mutable-strings (6)) (rnrs r5rs (6))) (display (find even? '(3 1 4 1 5 9))) (newline) (display "Hello\n") (guard (exn [(equal? exn 5) 'five...